mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-03 21:29:16 +02:00
See #297: linting of various, uncommon errors
This commit is contained in:
parent
ab80dffeea
commit
d17ceec1f0
29 changed files with 39 additions and 109 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue