Skip to content

Commit

Permalink
Remove locale setting from mommy
Browse files Browse the repository at this point in the history
1. We do not have translations
2. If Something ends up being in english this can be reverted
3. This makes our tests require having nb_NO/no_NO locale installed, and
   it is easier if we can just skip having to do that.
  • Loading branch information
henrikhorluck committed Mar 20, 2024
1 parent 8bf9b93 commit cf807b3
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 9 deletions.
2 changes: 0 additions & 2 deletions apps/events/mommy.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
import locale
import logging

from django.core.mail import EmailMessage
Expand All @@ -13,7 +12,6 @@
def set_event_marks():
logger = logging.getLogger()
logger.info("Attendance mark setting started")
locale.setlocale(locale.LC_ALL, "nb_NO.UTF-8")

# Gets all active attendance events thats suposed to give automatic marks
attendance_events = active_events()
Expand Down
2 changes: 0 additions & 2 deletions apps/feedback/mommy.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# -*- coding: utf-8 -*-

import locale
import logging

from django.conf import settings
Expand All @@ -15,7 +14,6 @@
def feedback_mail():
logger = logging.getLogger("feedback")
logger.info("Feedback job started")
locale.setlocale(locale.LC_ALL, "nb_NO.UTF-8")
active_feedbacks = FeedbackRelation.objects.filter(active=True)

for feedback in active_feedbacks:
Expand Down
3 changes: 0 additions & 3 deletions apps/payment/mommy.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# -*- coding: utf-8 -*-

import locale
import logging
from zoneinfo import ZoneInfo

Expand All @@ -21,7 +20,6 @@ def payment_reminder():
logging.basicConfig()
# logger = logging.getLogger()
# logger.info("Event payment job started")
locale.setlocale(locale.LC_ALL, "nb_NO.UTF-8")

event_payments = Payment.objects.filter(
payment_type=PaymentTypes.DEADLINE,
Expand Down Expand Up @@ -174,7 +172,6 @@ def payment_delay_handler():
logging.basicConfig()
logger = logging.getLogger("feedback")
logger.info("Payment delay handler started")
locale.setlocale(locale.LC_ALL, "nb_NO.UTF-8")

payment_delays = PaymentDelay.objects.filter(active=True)

Expand Down
4 changes: 2 additions & 2 deletions onlineweb4/settings/django.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@
TIME_ZONE = "Europe/Oslo"

# http://www.i18nguy.com/unicode/language-identifiers.html
LANGUAGE_CODE = "nb"
LANGUAGES = (("nb", "Norwegian"), ("en-US", "English"))
LANGUAGE_CODE = "nb-NO"
LANGUAGES = (("nb-NO", "Norwegian"), ("en-US", "English"))
LOCALE_PATHS = [os.path.join(PROJECT_ROOT_DIRECTORY, "locale")]

SITE_ID = 1
Expand Down

0 comments on commit cf807b3

Please sign in to comment.