Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TDDD83 Project
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Contributor 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
Show more breadcrumbs
Pontus Atuma Löfgren
TDDD83 Project
Merge requests
!33
Feature/serverside signup
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Feature/serverside signup
feature/serversideSignup
into
main
Overview
0
Commits
3
Pipelines
0
Changes
5
Merged
Pontus Atuma Löfgren
requested to merge
feature/serversideSignup
into
main
9 months ago
Overview
0
Commits
3
Pipelines
0
Changes
5
Expand
Sign-up / login now creates auth tokens
0
0
Merge request reports
Compare
main
main (base)
and
latest version
latest version
2c683462
3 commits,
9 months ago
5 files
+
54
−
48
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
5
Search (e.g. *.vue) (Ctrl+P)
server/classes/user.py
+
16
−
6
Options
@@ -2,10 +2,11 @@ from main import bcrypt
class
User
(
object
):
def
__init__
(
self
,
objID
,
email
=
None
,
pwHash
=
None
,
phoneNumber
=
None
,
fullName
=
None
,
def
__init__
(
self
,
objID
=
None
,
email
=
None
,
pwHash
=
None
,
phoneNumber
=
None
,
fullName
=
None
,
PNumber
=
None
,
isVerified
=
None
,
uni
=
None
,
studentID
=
None
,
homeAddress
=
None
,
sellLocation
=
None
,
isAdmin
=
None
):
self
.
id
=
objID
self
.
email
=
email
self
.
password_hash
=
pwHash
self
.
name
=
fullName
self
.
phone_number
=
phoneNumber
@@ -25,9 +26,18 @@ class User(object):
def
__repr__
(
self
):
return
'
<user {}: {}, email: {}, is_admin: {}>
'
.
format
(
self
.
id
,
self
.
name
,
self
.
email
,
self
.
is_admin
)
def
serialise_existing
(
self
):
full_serialised
=
self
.
serialize
()
retDict
=
{}
for
key
in
full_serialised
:
if
full_serialised
[
key
]
is
not
None
:
retDict
[
key
]
=
full_serialised
[
key
]
return
retDict
def
serialize
(
self
):
return
dict
(
id
=
self
.
id
,
pw_hash
=
self
.
pw_hash
,
name
=
self
.
name
,
phone_number
=
self
.
phone_number
,
personal_number
=
self
.
personal_number
,
is_verified
=
self
.
is_verified
,
university
=
self
.
university
,
student_id
=
self
.
student_id
,
address
=
self
.
address
,
location
=
self
.
location
,
is_admin
=
self
.
is_admin
)
#OBS!!!! _id = self.id, is not included in the serialisation of the object
return
dict
(
email
=
self
.
email
,
pwHash
=
self
.
password_hash
,
name
=
self
.
name
,
phoneNumber
=
self
.
phone_number
,
personalNumber
=
self
.
personal_number
,
isVerified
=
self
.
is_verified
,
university
=
self
.
university
,
studentID
=
self
.
student_id
,
address
=
self
.
address
,
location
=
self
.
location
,
isAdmin
=
self
.
is_admin
)
Loading