Skip to content
Snippets Groups Projects
Commit 27d594b8 authored by Jonas Braathen's avatar Jonas Braathen
Browse files

Make invitation link duration configurable

parent 0a5ec39b
No related branches found
No related tags found
1 merge request!299Show invitation status
import re import re
import typing import typing
from datetime import date, datetime, timedelta from datetime import date, datetime, timedelta
from django.conf import settings
from django.utils import timezone from django.utils import timezone
from greg.models import Identity from greg.models import Identity
...@@ -114,7 +115,7 @@ def date_to_datetime_midnight(in_date: typing.Union[date, str]) -> datetime: ...@@ -114,7 +115,7 @@ def date_to_datetime_midnight(in_date: typing.Union[date, str]) -> datetime:
def get_default_invitation_expire_date_from_now(): def get_default_invitation_expire_date_from_now():
return timezone.now() + timedelta(days=30) return timezone.now() + timedelta(days=settings.INVITATION_DURATION)
def is_identity_duplicate(identity_type: Identity.IdentityType, value: str) -> bool: def is_identity_duplicate(identity_type: Identity.IdentityType, value: str) -> bool:
......
...@@ -295,6 +295,8 @@ BASE_URL = "https://example.org" ...@@ -295,6 +295,8 @@ BASE_URL = "https://example.org"
FEIDE_SOURCE = "feide" FEIDE_SOURCE = "feide"
# The default duration for a new invitation link, in days
INVITATION_DURATION = 30
# Used by the OU import from orgreg to distinguish the OuIdentifiers from others # Used by the OU import from orgreg to distinguish the OuIdentifiers from others
ORGREG_SOURCE = "orgreg" ORGREG_SOURCE = "orgreg"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment