Commit 6fcda825 authored by Bryan  BRANCOTTE's avatar Bryan BRANCOTTE
Browse files

preferences managment become user dependant, allows to show settings for only a subset of users

parent e0b446d1
......@@ -88,21 +88,19 @@ class UserPreferencesAbstractModelWithoutUser(models.Model):
self._meta.verbose_name.title(),
)
@classmethod
def get_allowed_fields(cls):
if cls.preferences_groups is not None:
for group, fields in cls.preferences_groups.items():
def get_allowed_fields(self):
if self.preferences_groups is not None:
for group, fields in self.preferences_groups.items():
for f in fields:
yield f
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":
continue
yield field_name
@classmethod
@property
def preferences_groups(cls):
def preferences_groups(self):
return None
@property
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment