Commit 791a3653 by Victor Shnayder

simpify process_survey_link

parent 7546e6bb
......@@ -133,11 +133,7 @@ def process_survey_link(survey_link, user):
If {UNIQUE_ID} appears in the link, replace it with a unique id for the user.
Currently, this is sha1(user.username). Otherwise, return survey_link.
"""
to_replace = '{UNIQUE_ID}'
if to_replace in survey_link:
return survey_link.replace(to_replace, unique_id_for_user(user))
return survey_link
return survey_link.format(UNIQUE_ID=unique_id_for_user(user))
def cert_info(user, course):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment