mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-10-30 20:55:42 +00:00 
			
		
		
		
	Handle rare case where user instance has no name assigned
This commit is contained in:
		| @@ -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 | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user