django_rbac: always prevent empty uuid (#31083)
This commit is contained in:
parent
5b8b62a19f
commit
9159c4d70b
|
@ -57,6 +57,8 @@ class AbstractBase(models.Model):
|
|||
if len(self.slug) > 256:
|
||||
self.slug = self.slug[:252] + \
|
||||
hashlib.md5(self.slug).hexdigest()[:4]
|
||||
if not self.uuid:
|
||||
self.uuid = utils.get_hex_uuid()
|
||||
return super(AbstractBase, self).save(*args, **kwargs)
|
||||
|
||||
def natural_key(self):
|
||||
|
|
Loading…
Reference in New Issue