Skip to content

Commit

Permalink
Merge pull request #562 from edly-io/alisalman/update-defualt-lang
Browse files Browse the repository at this point in the history
update: default lang to Arabic and fix certificate fonts
  • Loading branch information
Ali-Salman29 authored Jul 11, 2024
2 parents c382f39 + 4adc715 commit cff2bc4
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 5 deletions.
6 changes: 3 additions & 3 deletions lms/static/certificates/sass/_sdaia-template.scss
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ html {
flex-direction: column;
}
&__personName {
font-size: 22px;
font-size: 30px;
}
&__subTitleBody,
&__personWrap,
Expand Down Expand Up @@ -187,7 +187,7 @@ html {
font-size: 18px;
}
&__personName {
font-size: 20px;
font-size: 26px;
}
}

Expand Down Expand Up @@ -262,7 +262,7 @@ html {
gap: 5px;
}
&__personName {
font-size: 18px;
font-size: 22px;
}
}
}
Expand Down
1 change: 1 addition & 0 deletions openedx/features/sdaia_features/course_progress/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class CourseProgressConfig(AppConfig):
PluginSettings.CONFIG: {
ProjectType.LMS: {
SettingsType.COMMON: {PluginSettings.RELATIVE_PATH: "settings.common"},
SettingsType.PRODUCTION: {PluginSettings.RELATIVE_PATH: "settings.production"},
}
},
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ def plugin_settings(settings):
"""
Required Common settings
"""
settings.SDAIA_DEFAULT_LANGUAGE_CODE = 'ar'
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

"""Settings"""


def plugin_settings(settings):
"""
Required Common settings
"""
settings.SDAIA_DEFAULT_LANGUAGE_CODE = settings.ENV_TOKENS.get(
'SDAIA_DEFAULT_LANGUAGE_CODE', settings.SDAIA_DEFAULT_LANGUAGE_CODE
)
17 changes: 15 additions & 2 deletions openedx/features/sdaia_features/course_progress/signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@
from django.dispatch import receiver
from django.contrib.auth.models import User # lint-amnesty, pylint: disable=imported-auth-user
from django.contrib.sites.models import Site
from django.conf import settings

from openedx.core.djangoapps.user_api.preferences import api as preferences_api
from openedx.core.djangoapps.lang_pref import LANGUAGE_KEY
from openedx.core.djangoapps.user_authn.views.register import REGISTER_USER
from openedx.core.djangoapps.signals.signals import COURSE_GRADE_NOW_PASSED
from openedx.core.lib.celery.task_utils import emulate_http_request
from openedx.features.sdaia_features.course_progress.models import CourseCompletionEmailHistory
Expand Down Expand Up @@ -41,7 +45,7 @@ def send_course_progress_milestones_achievement_emails(**kwargs):
try:
course_completion_percentages_for_emails = [int(entry.strip()) for entry in course_completion_percentages_for_emails]
except Exception as e:
log.info(f"invalid course_completion_percentages_for_emails for course {str(course_key)}")
logger.info(f"invalid course_completion_percentages_for_emails for course {str(course_key)}")
return

user_id = instance.user_id
Expand Down Expand Up @@ -70,4 +74,13 @@ def send_course_completion_email(sender, user, course_id, **kwargs): # pylint:
Listen for a signal indicating that the user has passed a course run.
"""
logger.info(f"\n\n\n inside send_course_completion_email \n\n\n")
send_user_course_completion_email.delay(user.id, str(course_id))
send_user_course_completion_email.delay(user.id, str(course_id))


@receiver(REGISTER_USER)
def update_account_preference(sender, user, registration, **kwargs):
"""
SDAIA: Update the user preference language to "SDAIA_DEFAULT_LANGUAGE_CODE" on a account creation
"""
if not preferences_api.get_user_preference(user, LANGUAGE_KEY) == settings.SDAIA_DEFAULT_LANGUAGE_CODE:
preferences_api.set_user_preference(user, LANGUAGE_KEY, settings.SDAIA_DEFAULT_LANGUAGE_CODE)

0 comments on commit cff2bc4

Please sign in to comment.