django_rbac: fix ContentType.__str__ variations (#64305)

This commit is contained in:
Paul Marillonnet 2022-04-22 12:29:17 +02:00
parent 503a983320
commit 9b0ac49118
1 changed files with 1 additions and 1 deletions

View File

@ -165,7 +165,7 @@ class PermissionAbstractBase(models.Model):
target = ContentType.objects.get_for_id(self.target_id)
s = f'{self.operation} / {target}'
else:
s = f'{self.operation} / {ct} / {self.target}'
s = f'{self.operation} / {ct.name} / {self.target}'
if self.ou:
s += gettext(' (scope "{0}")').format(self.ou)
return s