Skip to content

Commit

Permalink
minor fixes for limiation on registration (#344)
Browse files Browse the repository at this point in the history
  • Loading branch information
marslanabdulrauf authored Dec 14, 2022
1 parent b1a5a5d commit e2d3d5d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions openedx/features/edly/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,14 @@ def is_courses_limit_reached_for_plan():
return False


def get_subscription_limit(edly_sub_org):
def get_subscription_limit(edly_sub_org, current_plan=None):
"""
Checks if the limit for the current site for number of registered users is reached.
"""
site_config = configuration_helpers.get_current_site_configuration()
current_plan = site_config.get_value('DJANGO_SETTINGS_OVERRIDE', {}).get('CURRENT_PLAN', ESSENTIALS)
if not current_plan and site_config:
current_plan = site_config.get_value('DJANGO_SETTINGS_OVERRIDE', {}).get('CURRENT_PLAN', ESSENTIALS)

plan_features = settings.PLAN_FEATURES.get(current_plan)
registration_limit = plan_features.get(NUMBER_OF_REGISTERED_USERS)

Expand Down

0 comments on commit e2d3d5d

Please sign in to comment.