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
bc667fb5
Commit
bc667fb5
authored
3 years ago
by
Tore.Brede
Browse files
Options
Downloads
Patches
Plain Diff
GREG-85: Fixing formattting issues
parent
bd0b2f6d
No related branches found
No related tags found
1 merge request
!113
GREG-85: Guest registration page
Pipeline
#97528
failed
3 years ago
Stage: venv update
Stage: tests and linting
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
gregsite/settings/base.py
+1
-1
1 addition, 1 deletion
gregsite/settings/base.py
gregui/api/views/invitation.py
+11
-5
11 additions, 5 deletions
gregui/api/views/invitation.py
gregui/authentication/auth_backends.py
+11
-7
11 additions, 7 deletions
gregui/authentication/auth_backends.py
with
23 additions
and
13 deletions
gregsite/settings/base.py
+
1
−
1
View file @
bc667fb5
...
...
@@ -269,4 +269,4 @@ SCHEDULE_TASKS = {
INSTANCE_NAME
=
"
local
"
INTERNAL_RK_PREFIX
=
"
no.{instance}.greg
"
.
format
(
instance
=
INSTANCE_NAME
)
FEIDE_SOURCE
=
"
feide
"
\ No newline at end of file
FEIDE_SOURCE
=
"
feide
"
This diff is collapsed.
Click to expand it.
gregui/api/views/invitation.py
+
11
−
5
View file @
bc667fb5
...
...
@@ -139,7 +139,9 @@ class InvitedGuestView(GenericAPIView):
fnr_verified
=
False
try
:
fnr_identity
=
person
.
identities
.
get
(
type
=
Identity
.
IdentityType
.
NORWEGIAN_NATIONAL_ID_NUMBER
)
fnr_identity
=
person
.
identities
.
get
(
type
=
Identity
.
IdentityType
.
NORWEGIAN_NATIONAL_ID_NUMBER
)
fnr
=
fnr_identity
.
value
# TODO Maybe other criteria should be specified here
if
fnr
.
verified
==
Identity
.
Verified
.
AUTOMATIC
:
...
...
@@ -148,7 +150,9 @@ class InvitedGuestView(GenericAPIView):
fnr
=
None
try
:
passport
=
person
.
identities
.
get
(
type
=
Identity
.
IdentityType
.
PASSPORT_NUMBER
).
value
passport
=
person
.
identities
.
get
(
type
=
Identity
.
IdentityType
.
PASSPORT_NUMBER
).
value
except
Identity
.
DoesNotExist
:
passport
=
None
...
...
@@ -177,7 +181,7 @@ class InvitedGuestView(GenericAPIView):
"
meta
"
:
{
"
form_type
"
:
"
manual
"
if
is_not_logged_in
else
"
feide
"
,
"
fnr_verified
"
:
fnr_verified
,
}
}
,
}
return
JsonResponse
(
data
=
data
,
status
=
status
.
HTTP_200_OK
)
...
...
@@ -227,8 +231,10 @@ class InvitedGuestView(GenericAPIView):
def
_verified_fnr_already_exists
(
self
,
person
)
->
bool
:
try
:
person
.
identities
.
get
(
type
=
Identity
.
IdentityType
.
NORWEGIAN_NATIONAL_ID_NUMBER
,
verified
=
Identity
.
Verified
.
AUTOMATIC
)
person
.
identities
.
get
(
type
=
Identity
.
IdentityType
.
NORWEGIAN_NATIONAL_ID_NUMBER
,
verified
=
Identity
.
Verified
.
AUTOMATIC
,
)
return
True
except
Identity
.
DoesNotExist
:
return
False
...
...
This diff is collapsed.
Click to expand it.
gregui/authentication/auth_backends.py
+
11
−
7
View file @
bc667fb5
...
...
@@ -239,20 +239,24 @@ class GregOIDCBackend(ValidatingOIDCBackend):
# Find or create person, and add identity
person
=
self
.
_get_or_create_person
(
userinfo
)
identity
=
Identity
(
type
=
Identity
.
IdentityType
.
FEIDE_ID
,
value
=
userinfo
[
"
userid_feide
"
],
person
=
person
,
source
=
settings
.
FEIDE_SOURCE
,
verified
=
Identity
.
Verified
.
AUTOMATIC
,
verified_at
=
timezone
.
now
()
type
=
Identity
.
IdentityType
.
FEIDE_ID
,
value
=
userinfo
[
"
userid_feide
"
],
person
=
person
,
source
=
settings
.
FEIDE_SOURCE
,
verified
=
Identity
.
Verified
.
AUTOMATIC
,
verified_at
=
timezone
.
now
(),
)
identity
.
save
()
try
:
Identity
.
objects
.
get
(
type
=
"
private_email
"
,
value
=
userinfo
[
"
email
"
]
)
Identity
.
objects
.
get
(
type
=
"
private_email
"
,
value
=
userinfo
[
"
email
"
])
except
Identity
.
DoesNotExist
:
# Add email if missing
email_identity
=
Identity
(
type
=
"
private_email
"
,
value
=
userinfo
[
"
email
"
],
person
=
person
,
source
=
settings
.
FEIDE_SOURCE
,
type
=
"
private_email
"
,
value
=
userinfo
[
"
email
"
],
person
=
person
,
source
=
settings
.
FEIDE_SOURCE
,
)
email_identity
.
save
()
...
...
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