Skip to content
Snippets Groups Projects
Unverified Commit 501cd679 authored by Calen Pennington's avatar Calen Pennington Committed by GitHub
Browse files

Merge pull request #22001 from cpennington/no-discount-for-anonymous-users

Don't try to show anonymous users the first-purchase discount
parents bf3d3373 355826f7
No related merge requests found
......@@ -69,6 +69,9 @@ def can_receive_discount(user, course): # pylint: disable=unused-argument
if DiscountRestrictionConfig.disabled_for_course_stacked_config(course):
return False
if user.is_anonymous:
return False
# Don't allow users who have enrolled in any courses in non-upsellable
# modes
if CourseEnrollment.objects.filter(user=user).exclude(mode__in=CourseMode.UPSELL_TO_VERIFIED_MODES).exists():
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment