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):
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
for field_name in [ for f in cls._meta.get_fields()]:
for field_name in [ for f in self._meta.get_fields()]:
if field_name == "id" or field_name == "pk" or field_name == "user":
yield field_name
def preferences_groups(cls):
def preferences_groups(self):
return None
Supports Markdown
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