Skip to content

Commit

Permalink
Workaround to fix redirection
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronlifshin committed Oct 31, 2014
1 parent fc63a62 commit 8313209
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions backend/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,15 +370,22 @@ def post(self):
self.error(400)
return

redirect_input = cgi.escape(self.request.get('redirect'))
dont_redirect = cgi.escape(self.request.get('dont_redirect'))
if dont_redirect == True:
if redirect_input != '':
logging.info('REDIRECT param exists. Setting don\'t redirect to false ')
dont_redirect = False
else:
dont_redirect = True

if dont_redirect == True:
logging.info('Setting don\'t redirect to false')
dont_redirect = False
else:
logging.info('Setting don\'t redirect to TRUE')
dont_redirect = True

is_supporter = cgi.escape(self.request.get('is_supporter'))
if type(is_supporter) != bool:
is_supporter = False
is_supporter = False

first_name = cgi.escape(self.request.get('first_name'))
if len(first_name) == 0:
Expand Down Expand Up @@ -448,7 +455,6 @@ def post(self):
is_supporter=is_supporter
)

redirect_input = cgi.escape(self.request.get('redirect'))
if dont_redirect == False:
if len(redirect_input)>0:
redirect_url = '%s?email=%s&source=%s' % (redirect_input, email_input, source_input)
Expand Down

0 comments on commit 8313209

Please sign in to comment.