Skip to content

Commit

Permalink
changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Taimoor Ahmed authored and Taimoor Ahmed committed May 14, 2024
1 parent 9f05277 commit 62bb430
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
15 changes: 9 additions & 6 deletions course_discovery/apps/edly_discovery_app/api/v1/constants.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
"""
Constants for Edly Sites API.
"""
from enum import Enum

from django.utils.translation import ugettext as _

ERROR_MESSAGES = {
Expand All @@ -20,9 +22,10 @@

DEFAULT_COURSE_ID = 'course-v1:{}+get_started_with+Edly'

TRIAL_PLAN = 'trial'
ESSENTIALS_PLAN = 'essentials'
ELITE_PLAN = 'elite'
TRIAL_EXPIRED_PLAN = 'trial expired'
DEACTIVATED_PLAN = 'deactivated'
LEGACY_PLAN = 'legacy'
class CoursePlans(Enum):
TRIAL = 'trial'
ESSENTIALS = 'essentials'
ELITE_PLAN = 'elite'
TRIAL_EXPIRED = 'trial expired'
DEACTIVATED = 'deactivated'
LEGACY = 'legacy'
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

from course_discovery.apps.core.models import Partner
from course_discovery.apps.edly_discovery_app.tasks import run_dataloader
from edly_discovery_app.api.v1.constants import DEACTIVATED_PLAN, DEFAULT_COURSE_ID, ERROR_MESSAGES
from edly_discovery_app.api.v1.constants import CoursePlans, DEFAULT_COURSE_ID, ERROR_MESSAGES
from edly_discovery_app.api.v1.helpers import validate_partner_configurations
from edly_discovery_app.api.v1.permissions import CanAccessSiteCreation

Expand Down Expand Up @@ -111,7 +111,7 @@ def post(self, request):
site_partner = Partner.objects.get(site=site)
request_data = request.data.get('discovery', {})
current_plan = request_data.get('DJANGO_SETTINGS_OVERRIDE', {}).get('CURRENT_PLAN')
if current_plan == DEACTIVATED_PLAN:
if current_plan == CoursePlans.DEACTIVATED:
site_partner.is_disabled = True
site_partner.save()

Expand Down

0 comments on commit 62bb430

Please sign in to comment.