Skip to content

Commit

Permalink
💚 FIX CI build
Browse files Browse the repository at this point in the history
  • Loading branch information
stefrado committed Nov 18, 2024
1 parent 4e62c96 commit 0503625
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/sdg/utils/context_processors.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
from django.conf import settings as django_settings
from django.utils.timezone import now

from dateutil.relativedelta import relativedelta

from sdg.conf.utils import org_type_cfg
from sdg.producten.models import NotificationViewed, ProductVersie
from django.utils.timezone import now
from dateutil.relativedelta import relativedelta


def settings(request):
Expand Down Expand Up @@ -38,15 +39,13 @@ def has_new_notifications(request):
except NotificationViewed.DoesNotExist:
notification_viewed = None


# Get the last_viewed_date from data
try:
last_viewed_date = notification_viewed.last_viewed_date
except AttributeError:
# default last_viewed_date is 12 months ago
last_viewed_date = now() - relativedelta(months=12)


# Get the latest product version after the last_viewed_date else None.
latest_notification = (
ProductVersie.objects.filter(
Expand Down

0 comments on commit 0503625

Please sign in to comment.