clear role cache on save
This commit is contained in:
parent
7cb16b2259
commit
c02ab50a0a
|
@ -197,6 +197,12 @@ class Role(BaseAuditModel):
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return self.name
|
return self.name
|
||||||
|
|
||||||
|
def save(self, *args, **kwargs) -> None:
|
||||||
|
|
||||||
|
# delete cache on save
|
||||||
|
cache.delete(f"{ROLE_CACHE_PREFIX}{self.name}")
|
||||||
|
super(BaseAuditModel, self).save(*args, **kwargs)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def serialize(role):
|
def serialize(role):
|
||||||
# serializes the agent and returns json
|
# serializes the agent and returns json
|
||||||
|
|
Loading…
Reference in New Issue