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
c19bca52
Commit
c19bca52
authored
3 years ago
by
Andreas Ellewsen
Browse files
Options
Downloads
Patches
Plain Diff
Add mandatory field to ConsentType
parent
7d8a7d50
No related branches found
No related tags found
1 merge request
!43
Feature/hasconsented
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
greg/admin.py
+7
-1
7 additions, 1 deletion
greg/admin.py
greg/migrations/0003_consenttype_mandatory.py
+18
-0
18 additions, 0 deletions
greg/migrations/0003_consenttype_mandatory.py
greg/models.py
+1
-0
1 addition, 0 deletions
greg/models.py
with
26 additions
and
1 deletion
greg/admin.py
+
7
−
1
View file @
c19bca52
...
@@ -79,7 +79,13 @@ class ConsentAdmin(VersionAdmin):
...
@@ -79,7 +79,13 @@ class ConsentAdmin(VersionAdmin):
class
ConsentTypeAdmin
(
admin
.
ModelAdmin
):
class
ConsentTypeAdmin
(
admin
.
ModelAdmin
):
list_display
=
(
"
id
"
,
"
name_en
"
,
"
valid_from
"
,
"
user_allowed_to_change
"
)
list_display
=
(
"
id
"
,
"
name_en
"
,
"
valid_from
"
,
"
user_allowed_to_change
"
,
"
mandatory
"
,
)
readonly_fields
=
(
"
id
"
,
"
created
"
,
"
updated
"
)
readonly_fields
=
(
"
id
"
,
"
created
"
,
"
updated
"
)
...
...
This diff is collapsed.
Click to expand it.
greg/migrations/0003_consenttype_mandatory.py
0 → 100644
+
18
−
0
View file @
c19bca52
# Generated by Django 3.2.7 on 2021-09-03 10:59
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'
greg
'
,
'
0002_identity
'
),
]
operations
=
[
migrations
.
AddField
(
model_name
=
'
consenttype
'
,
name
=
'
mandatory
'
,
field
=
models
.
BooleanField
(
default
=
False
),
),
]
This diff is collapsed.
Click to expand it.
greg/models.py
+
1
−
0
View file @
c19bca52
...
@@ -247,6 +247,7 @@ class ConsentType(BaseModel):
...
@@ -247,6 +247,7 @@ class ConsentType(BaseModel):
link_nb
=
models
.
URLField
(
null
=
True
)
link_nb
=
models
.
URLField
(
null
=
True
)
valid_from
=
models
.
DateField
(
default
=
date
.
today
)
valid_from
=
models
.
DateField
(
default
=
date
.
today
)
user_allowed_to_change
=
models
.
BooleanField
()
user_allowed_to_change
=
models
.
BooleanField
()
mandatory
=
models
.
BooleanField
(
default
=
False
)
def
__str__
(
self
):
def
__str__
(
self
):
return
"
{} ({})
"
.
format
(
str
(
self
.
name_en
or
self
.
name_nb
),
self
.
identifier
)
return
"
{} ({})
"
.
format
(
str
(
self
.
name_en
or
self
.
name_nb
),
self
.
identifier
)
...
...
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