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
b4467581
Commit
b4467581
authored
3 years ago
by
Tore.Brede
Browse files
Options
Downloads
Patches
Plain Diff
GREG-85: Fixing problem with wrong data inserted into response
parent
094594b7
No related branches found
No related tags found
1 merge request
!113
GREG-85: Guest registration page
Pipeline
#97524
failed
3 years ago
Stage: venv update
Stage: tests and linting
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
frontend/src/routes/guest/register/index.tsx
+2
-0
2 additions, 0 deletions
frontend/src/routes/guest/register/index.tsx
gregui/api/views/invitation.py
+7
-4
7 additions, 4 deletions
gregui/api/views/invitation.py
with
9 additions
and
4 deletions
frontend/src/routes/guest/register/index.tsx
+
2
−
0
View file @
b4467581
...
@@ -61,6 +61,8 @@ export default function GuestRegister() {
...
@@ -61,6 +61,8 @@ export default function GuestRegister() {
if
(
response
.
ok
)
{
if
(
response
.
ok
)
{
response
.
json
().
then
((
jsonResponse
)
=>
{
response
.
json
().
then
((
jsonResponse
)
=>
{
console
.
log
(
`Guest data from server:
${
JSON
.
stringify
(
jsonResponse
)}
`
)
const
authenticationMethod
=
const
authenticationMethod
=
jsonResponse
.
meta
.
form_type
===
'
manual
'
jsonResponse
.
meta
.
form_type
===
'
manual
'
?
AuthenticationMethod
.
NationalIdNumberOrPassport
?
AuthenticationMethod
.
NationalIdNumberOrPassport
...
...
This diff is collapsed.
Click to expand it.
gregui/api/views/invitation.py
+
7
−
4
View file @
b4467581
import
json
import
json
import
datetime
import
datetime
from
uuid
import
uuid4
from
uuid
import
uuid4
from
django.contrib.auth.models
import
AnonymousUser
from
django.core
import
exceptions
from
django.core
import
exceptions
from
django.db
import
transaction
from
django.db
import
transaction
from
django.http.response
import
JsonResponse
from
django.http.response
import
JsonResponse
...
@@ -133,11 +135,12 @@ class InvitedGuestView(GenericAPIView):
...
@@ -133,11 +135,12 @@ class InvitedGuestView(GenericAPIView):
sponsor
=
role
.
sponsor_id
sponsor
=
role
.
sponsor_id
# If the user is not logged in then tell the client to take him through the manual registration process
# If the user is not logged in then tell the client to take him through the manual registration process
is_not_logged_in
=
request
.
user
is_not_logged_in
=
request
.
user
.
is_anonymous
fnr_verified
=
False
fnr_verified
=
False
try
:
try
:
fnr
=
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
# TODO Maybe other criteria should be specified here
if
fnr
.
verified
==
Identity
.
Verified
.
AUTOMATIC
:
if
fnr
.
verified
==
Identity
.
Verified
.
AUTOMATIC
:
fnr_verified
=
True
fnr_verified
=
True
...
@@ -155,7 +158,7 @@ class InvitedGuestView(GenericAPIView):
...
@@ -155,7 +158,7 @@ class InvitedGuestView(GenericAPIView):
"
last_name
"
:
person
.
last_name
,
"
last_name
"
:
person
.
last_name
,
"
email
"
:
person
.
private_email
and
person
.
private_email
.
value
,
"
email
"
:
person
.
private_email
and
person
.
private_email
.
value
,
"
mobile_phone
"
:
person
.
private_mobile
and
person
.
private_mobile
.
value
,
"
mobile_phone
"
:
person
.
private_mobile
and
person
.
private_mobile
.
value
,
"
fnr
"
:
fnr
and
fnr
.
value
,
"
fnr
"
:
fnr
,
"
passport
"
:
passport
,
"
passport
"
:
passport
,
},
},
"
sponsor
"
:
{
"
sponsor
"
:
{
...
@@ -172,7 +175,7 @@ class InvitedGuestView(GenericAPIView):
...
@@ -172,7 +175,7 @@ class InvitedGuestView(GenericAPIView):
"
comments
"
:
role
.
comments
,
"
comments
"
:
role
.
comments
,
},
},
"
meta
"
:
{
"
meta
"
:
{
"
form_type
"
:
is_not_logged_in
,
"
form_type
"
:
"
manual
"
if
is_not_logged_in
else
"
feide
"
,
"
fnr_verified
"
:
fnr_verified
,
"
fnr_verified
"
:
fnr_verified
,
}
}
}
}
...
...
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