filter attributs does not necessary exists
This commit is contained in:
parent
02fd557216
commit
1695cd24ea
@ -175,8 +175,8 @@ class ServicePattern(models.Model):
|
||||
if self.restrict_users and not self.usernames.filter(value=user.username):
|
||||
raise BadUsername()
|
||||
for filtre in self.filters.all():
|
||||
if isinstance(user.attributs[filtre.attribut], list):
|
||||
attrs = user.attributs[filtre.attribut]
|
||||
if isinstance(user.attributs.get(filtre.attribut, []), list):
|
||||
attrs = user.attributs.get(filtre.attribut, [])
|
||||
else:
|
||||
attrs = [user.attributs[filtre.attribut]]
|
||||
for value in attrs:
|
||||
|
Loading…
Reference in New Issue
Block a user