Skip to content

Commit

Permalink
Merge pull request #827 from Inter-Actief/cookie_corner_wrapped_year
Browse files Browse the repository at this point in the history
Allow configurable cookie corner wrapped year
  • Loading branch information
bramvandartel authored Dec 14, 2023
2 parents ca3dab5 + cdb422e commit e7cdcaa
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion amelie/personal_tab/templates/cookie_corner_dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ <h2>
{% trans 'History of exam credit' %}
</a>
<a href="{% url 'personal_tab:cookie_corner_wrapped' %}" class="looks-like-a-button">
{% trans 'Cookie Corner Wrapped' %} {{ last_year }}
{% trans 'Cookie Corner Wrapped' %} {{ wrapped_year }}
</a>
{% endif %}
</div>
Expand Down
6 changes: 4 additions & 2 deletions amelie/personal_tab/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import logging
from decimal import Decimal
import itertools

import django.conf
import operator
from django.contrib import messages
from django.contrib.auth.decorators import login_required
Expand Down Expand Up @@ -634,7 +636,7 @@ def dashboard(request, pk, slug):
'debt_collection_instructions': debt_collection_instructions,
'exam_cookie_credits': exam_cookie_credits,
'date_old_authorizations': date_old_authorizations,
'last_year': datetime.date.today().year - 1
'wrapped_year': django.conf.settings.COOKIE_CORNER_WRAPPED_YEAR
})


Expand Down Expand Up @@ -1716,7 +1718,7 @@ def authorization_view(request, authorization_id):

@require_lid
def cookie_corner_wrapped_main(request):
COOKIE_CORNER_WRAPPED_YEAR = datetime.date.today().year - 1
COOKIE_CORNER_WRAPPED_YEAR = django.conf.settings.COOKIE_CORNER_WRAPPED_YEAR

person = request.person
language = get_language()
Expand Down
3 changes: 3 additions & 0 deletions amelie/settings/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import os
import re
import saml2
import datetime
from datetime import date
from decimal import Decimal

Expand Down Expand Up @@ -901,3 +902,5 @@
KEYCLOAK_API_CLIENT_SECRET = ""
KEYCLOAK_API_AUTHN_ENDPOINT = "https://auth.ia.utwente.nl/realms/inter-actief/protocol/openid-connect/token"
KEYCLOAK_PROVIDERS_UNLINK_ALLOWED = ['github', 'google', 'linkedin']

COOKIE_CORNER_WRAPPED_YEAR = datetime.date.today().year - 1

0 comments on commit e7cdcaa

Please sign in to comment.