From d723bb71037aed46c30d7d1fb8db885c96d0abbd Mon Sep 17 00:00:00 2001 From: Victor Shnayder <victor@edx.org> Date: Mon, 19 Nov 2012 11:39:43 -0500 Subject: [PATCH] simpify process_survey_link --- common/djangoapps/student/views.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/common/djangoapps/student/views.py b/common/djangoapps/student/views.py index ac3a97bd895..91627150fc2 100644 --- a/common/djangoapps/student/views.py +++ b/common/djangoapps/student/views.py @@ -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): -- GitLab