mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-29 20:16:44 +00:00
Handle rare case where user instance has no name assigned
This commit is contained in:
parent
772d3fa67d
commit
40e5536300
@ -216,7 +216,10 @@ class RuleSet(models.Model):
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
# Print message instead of throwing an error
|
# Print message instead of throwing an error
|
||||||
logger.info(f"User '{user.name}' failed permission check for {table}.{permission}")
|
name = getattr(user, 'name', user.pk)
|
||||||
|
|
||||||
|
logger.info(f"User '{name}' failed permission check for {table}.{permission}")
|
||||||
|
|
||||||
return False
|
return False
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
Loading…
x
Reference in New Issue
Block a user