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
c2fa319f
Commit
c2fa319f
authored
3 years ago
by
Tore.Brede
Browse files
Options
Downloads
Patches
Plain Diff
GREG-165: Fixing formatting
parent
031d6bf5
No related branches found
No related tags found
1 merge request
!239
GREG-165: Part 1 : Handle missing information from Feide
Pipeline
#109552
passed
3 years ago
Stage: venv update
Stage: tests and linting
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gregui/api/views/invitation.py
+11
-7
11 additions, 7 deletions
gregui/api/views/invitation.py
with
11 additions
and
7 deletions
gregui/api/views/invitation.py
+
11
−
7
View file @
c2fa319f
...
...
@@ -73,8 +73,8 @@ class InvitationView(CreateAPIView, DestroyAPIView):
person
=
serializer
.
save
()
for
invitationlink
in
InvitationLink
.
objects
.
filter
(
invitation__role__person_id
=
person
.
id
,
invitation__role__sponsor_id
=
sponsor_user
.
sponsor_id
,
invitation__role__person_id
=
person
.
id
,
invitation__role__sponsor_id
=
sponsor_user
.
sponsor_id
,
):
try
:
send_invite_mail
(
invitationlink
)
...
...
@@ -317,7 +317,7 @@ class InvitedGuestView(GenericAPIView):
return
Response
(
status
=
status
.
HTTP_200_OK
)
def
_verify_only_allowed_updates_in_request
(
self
,
person
:
Person
,
data
self
,
person
:
Person
,
data
)
->
Optional
[
Response
]:
# This is not a case that is expected to happen, but having the check here as a safeguard
# since it is an indication of a bug if does
...
...
@@ -384,13 +384,17 @@ class InvitedGuestView(GenericAPIView):
@staticmethod
def
_verified_fnr_already_exists
(
person
)
->
bool
:
return
person
.
identities
.
filter
(
Q
(
type
=
Identity
.
IdentityType
.
NORWEGIAN_NATIONAL_ID_NUMBER
)
&
~
Q
(
verified
=
None
)).
first
()
is
not
None
return
(
person
.
identities
.
filter
(
Q
(
type
=
Identity
.
IdentityType
.
NORWEGIAN_NATIONAL_ID_NUMBER
)
&
~
Q
(
verified
=
None
)
).
first
()
is
not
None
)
@staticmethod
def
_get_identity_or_none
(
person
:
Person
,
identity_type
:
Identity
.
IdentityType
person
:
Person
,
identity_type
:
Identity
.
IdentityType
)
->
Optional
[
str
]:
try
:
return
person
.
identities
.
get
(
type
=
identity_type
).
value
...
...
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