Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
compendium-v2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
geant-swd
compendium-v2
Commits
ee597098
Commit
ee597098
authored
1 year ago
by
Bjarke Madsen
Browse files
Options
Downloads
Patches
Plain Diff
Fix auth_model uuid with sqlite
parent
b80a5bf7
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
compendium_v2/db/auth_model.py
+11
-1
11 additions, 1 deletion
compendium_v2/db/auth_model.py
with
11 additions
and
1 deletion
compendium_v2/db/auth_model.py
+
11
−
1
View file @
ee597098
...
@@ -25,7 +25,7 @@ class ROLES(Enum):
...
@@ -25,7 +25,7 @@ class ROLES(Enum):
user
=
"
user
"
user
=
"
user
"
uuid_pk
=
Annotated
[
UUID
,
mapped_column
(
primary_key
=
True
,
default
=
lambda
_
:
str
(
uuid4
())
)
]
uuid_pk
=
Annotated
[
UUID
,
mapped_column
(
primary_key
=
True
,
default
=
lambda
_
:
uuid4
())]
int_pk_fkNREN
=
Annotated
[
int
,
mapped_column
(
ForeignKey
(
"
nren.id
"
),
primary_key
=
True
)]
int_pk_fkNREN
=
Annotated
[
int
,
mapped_column
(
ForeignKey
(
"
nren.id
"
),
primary_key
=
True
)]
# TODO: active should be default False and require admin approval
# TODO: active should be default False and require admin approval
...
@@ -71,3 +71,13 @@ class User(UserMixin, db.Model):
...
@@ -71,3 +71,13 @@ class User(UserMixin, db.Model):
@property
@property
def
is_active
(
self
):
def
is_active
(
self
):
return
self
.
active
return
self
.
active
@property
def
is_admin
(
self
):
return
self
.
roles
==
ROLES
.
admin
@property
def
nren
(
self
):
if
len
(
self
.
nrens
)
==
0
:
return
None
return
self
.
nrens
[
0
]
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