Skip to content

Commit b904643

Browse files
committed
fixing lead landing with no offer. Closes #2486
1 parent 4baf781 commit b904643

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

pythonpro/core/tests/test_lead_landing_page.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,3 +211,7 @@ def resp_lead_creation_with_no_offer(client, db, fake: Faker, create_lead_mock,
211211

212212
def test_should_redirect_to_one_time_offer(resp_lead_creation):
213213
assert resp_lead_creation['Location'] == reverse('webdev_landing_page_oto')
214+
215+
216+
def test_should_redirect_to_thanks_page_direclty(resp_lead_creation_with_no_offer):
217+
assert resp_lead_creation_with_no_offer['Location'] == reverse('core:thanks')

pythonpro/core/views.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,9 @@ def _lead_form(request, *args, **kwargs):
178178
return render(request, 'core/lead_form_errors.html', context={'form': e.form}, status=400)
179179

180180
login(request, user)
181+
182+
if kwargs.get('redirect_to_OTO') is False:
183+
return redirect(reverse('core:thanks'))
181184
return redirect(reverse('webdev_landing_page_oto'))
182185

183186

0 commit comments

Comments
 (0)