Commit 3aa02f29 by Calen Pennington Committed by GitHub

Merge pull request #15880 from edx/ret/remove-extraneous-request-argument

Remove extraneous request argument to experiments.utils.check_and_get…
parents c773e45b 127e90e3
...@@ -152,7 +152,6 @@ class ChooseModeView(View): ...@@ -152,7 +152,6 @@ class ChooseModeView(View):
} }
context.update( context.update(
get_experiment_user_metadata_context( get_experiment_user_metadata_context(
request,
course, course,
request.user, request.user,
) )
......
...@@ -348,7 +348,6 @@ class CoursewareIndex(View): ...@@ -348,7 +348,6 @@ class CoursewareIndex(View):
} }
courseware_context.update( courseware_context.update(
get_experiment_user_metadata_context( get_experiment_user_metadata_context(
request,
self.course, self.course,
self.effective_user, self.effective_user,
) )
......
...@@ -329,7 +329,6 @@ def course_info(request, course_id): ...@@ -329,7 +329,6 @@ def course_info(request, course_id):
} }
context.update( context.update(
get_experiment_user_metadata_context( get_experiment_user_metadata_context(
request,
course, course,
user, user,
) )
...@@ -533,7 +532,6 @@ class CourseTabView(EdxFragmentView): ...@@ -533,7 +532,6 @@ class CourseTabView(EdxFragmentView):
} }
context.update( context.update(
get_experiment_user_metadata_context( get_experiment_user_metadata_context(
request,
course, course,
request.user, request.user,
) )
...@@ -896,7 +894,6 @@ def _progress(request, course_key, student_id): ...@@ -896,7 +894,6 @@ def _progress(request, course_key, student_id):
} }
context.update( context.update(
get_experiment_user_metadata_context( get_experiment_user_metadata_context(
request,
course, course,
student, student,
) )
......
...@@ -486,7 +486,6 @@ def _create_discussion_board_context(request, base_context, thread=None): ...@@ -486,7 +486,6 @@ def _create_discussion_board_context(request, base_context, thread=None):
}) })
context.update( context.update(
get_experiment_user_metadata_context( get_experiment_user_metadata_context(
request,
course, course,
user, user,
) )
......
...@@ -7,21 +7,20 @@ from courseware.date_summary import ( ...@@ -7,21 +7,20 @@ from courseware.date_summary import (
) )
def check_and_get_upgrade_link(request, user, course_id): def check_and_get_upgrade_link(user, course_id):
""" """
For an authenticated user, return a link to allow them to upgrade For an authenticated user, return a link to allow them to upgrade
in the specified course. in the specified course.
""" """
if request.user.is_authenticated(): if user.is_authenticated():
upgrade_data = VerifiedUpgradeDeadlineDate(None, user, course_id=course_id) upgrade_data = VerifiedUpgradeDeadlineDate(None, user, course_id=course_id)
if upgrade_data.is_enabled: if upgrade_data.is_enabled:
request.need_to_set_upgrade_cookie = True
return upgrade_data return upgrade_data
return None return None
def get_experiment_user_metadata_context(request, course, user): def get_experiment_user_metadata_context(course, user):
""" """
Return a context dictionary with the keys used by the user_metadata.html. Return a context dictionary with the keys used by the user_metadata.html.
""" """
...@@ -35,7 +34,7 @@ def get_experiment_user_metadata_context(request, course, user): ...@@ -35,7 +34,7 @@ def get_experiment_user_metadata_context(request, course, user):
except CourseEnrollment.DoesNotExist: except CourseEnrollment.DoesNotExist:
pass # Not enrolled, used the default None values pass # Not enrolled, used the default None values
upgrade_data = check_and_get_upgrade_link(request, user, course.id) upgrade_data = check_and_get_upgrade_link(user, course.id)
return { return {
'upgrade_link': upgrade_data and upgrade_data.link, 'upgrade_link': upgrade_data and upgrade_data.link,
......
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