mirror of
https://github.com/ae-utbm/sith.git
synced 2026-11-20 07:59:50 +00:00
end barmanship on ban
This commit is contained in:
1 parent
079ec8a8e5
commit
e45b4eb9e0
2 files changed
+30
-5
No files matched your search
@@ -769,6 +769,14 @@ class UserBan(models.Model):
|
||||
def __str__(self):
|
||||
return f"Ban of user {self.user.id}"
|
||||
|
||||
def save(self, *args, **kwargs):
|
||||
if self.ban_group_id in [
|
||||
settings.SITH_GROUP_BANNED_COUNTER_ID,
|
||||
settings.SITH_GROUP_BANNED_SUBSCRIPTION_ID,
|
||||
]:
|
||||
self.user.counters.clear()
|
||||
return super().save(*args, **kwargs)
|
||||
|
||||
|
||||
class GlobalPermissionRights(models.Model):
|
||||
"""Little hack to have permissions not linked to a specific db table."""
|
||||
|
||||
Reference in new issue
Block a user