Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
greg
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
it-bott-integrasjoner
greg
Commits
27d594b8
Commit
27d594b8
authored
3 years ago
by
Jonas Braathen
Browse files
Options
Downloads
Patches
Plain Diff
Make invitation link duration configurable
parent
0a5ec39b
No related branches found
No related tags found
1 merge request
!299
Show invitation status
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
greg/utils.py
+2
-1
2 additions, 1 deletion
greg/utils.py
gregsite/settings/base.py
+2
-0
2 additions, 0 deletions
gregsite/settings/base.py
with
4 additions
and
1 deletion
greg/utils.py
+
2
−
1
View file @
27d594b8
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
:
...
...
This diff is collapsed.
Click to expand it.
gregsite/settings/base.py
+
2
−
0
View file @
27d594b8
...
@@ -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
"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment