See #297: linting of various, uncommon errors

This commit is contained in:
Eliot Berriot 2018-06-10 12:06:46 +02:00
parent ab80dffeea
commit d17ceec1f0
No known key found for this signature in database
GPG key ID: DD6965E2476E5C27
29 changed files with 39 additions and 109 deletions

View file

@ -90,7 +90,8 @@ class User(AbstractUser):
perms[p] = v
return perms
def has_permissions(self, *perms, operator="and"):
def has_permissions(self, *perms, **kwargs):
operator = kwargs.pop("operator", "and")
if operator not in ["and", "or"]:
raise ValueError("Invalid operator {}".format(operator))
permissions = self.get_permissions()