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):
}
context.update(
get_experiment_user_metadata_context(
request,
course,
request.user,
)
......
......@@ -348,7 +348,6 @@ class CoursewareIndex(View):
}
courseware_context.update(
get_experiment_user_metadata_context(
request,
self.course,
self.effective_user,
)
......
......@@ -329,7 +329,6 @@ def course_info(request, course_id):
}
context.update(
get_experiment_user_metadata_context(
request,
course,
user,
)
......@@ -533,7 +532,6 @@ class CourseTabView(EdxFragmentView):
}
context.update(
get_experiment_user_metadata_context(
request,
course,
request.user,
)
......@@ -896,7 +894,6 @@ def _progress(request, course_key, student_id):
}
context.update(
get_experiment_user_metadata_context(
request,
course,
student,
)
......
......@@ -486,7 +486,6 @@ def _create_discussion_board_context(request, base_context, thread=None):
})
context.update(
get_experiment_user_metadata_context(
request,
course,
user,
)
......
......@@ -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
in the specified course.
"""
if request.user.is_authenticated():
if user.is_authenticated():
upgrade_data = VerifiedUpgradeDeadlineDate(None, user, course_id=course_id)
if upgrade_data.is_enabled:
request.need_to_set_upgrade_cookie = True
return upgrade_data
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.
"""
......@@ -35,7 +34,7 @@ def get_experiment_user_metadata_context(request, course, user):
except CourseEnrollment.DoesNotExist:
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 {
'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