Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update: default lang to Arabic and fix certificate fonts #562

Merged
merged 2 commits into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
)
18 changes: 16 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,14 @@ 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))


Ali-Salman29 marked this conversation as resolved.
Show resolved Hide resolved

@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)
Loading