Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
django-basetheme-bootstrap
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
Model registry
Operate
Environments
Terraform modules
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Bryan BRANCOTTE
django-basetheme-bootstrap
Commits
6fcda825
Commit
6fcda825
authored
4 years ago
by
Bryan BRANCOTTE
Browse files
Options
Downloads
Patches
Plain Diff
preferences managment become user dependant, allows to show settings for only a subset of users
parent
e0b446d1
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
basetheme_bootstrap/user_preferences_utils.py
+5
-7
5 additions, 7 deletions
basetheme_bootstrap/user_preferences_utils.py
with
5 additions
and
7 deletions
basetheme_bootstrap/user_preferences_utils.py
+
5
−
7
View file @
6fcda825
...
@@ -88,21 +88,19 @@ class UserPreferencesAbstractModelWithoutUser(models.Model):
...
@@ -88,21 +88,19 @@ class UserPreferencesAbstractModelWithoutUser(models.Model):
self
.
_meta
.
verbose_name
.
title
(),
self
.
_meta
.
verbose_name
.
title
(),
)
)
@classmethod
def
get_allowed_fields
(
self
):
def
get_allowed_fields
(
cls
):
if
self
.
preferences_groups
is
not
None
:
if
cls
.
preferences_groups
is
not
None
:
for
group
,
fields
in
self
.
preferences_groups
.
items
():
for
group
,
fields
in
cls
.
preferences_groups
.
items
():
for
f
in
fields
:
for
f
in
fields
:
yield
f
yield
f
return
return
for
field_name
in
[
f
.
name
for
f
in
cls
.
_meta
.
get_fields
()]:
for
field_name
in
[
f
.
name
for
f
in
self
.
_meta
.
get_fields
()]:
if
field_name
==
"
id
"
or
field_name
==
"
pk
"
or
field_name
==
"
user
"
:
if
field_name
==
"
id
"
or
field_name
==
"
pk
"
or
field_name
==
"
user
"
:
continue
continue
yield
field_name
yield
field_name
@classmethod
@property
@property
def
preferences_groups
(
cls
):
def
preferences_groups
(
self
):
return
None
return
None
@property
@property
...
...
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