mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-10-31 13:15:43 +00:00 
			
		
		
		
	Prevent creation of new settings objects when importing data (#3319)
This commit is contained in:
		| @@ -343,6 +343,10 @@ class BaseInvenTreeSetting(models.Model): | |||||||
|             # Unless otherwise specified, attempt to create the setting |             # Unless otherwise specified, attempt to create the setting | ||||||
|             create = kwargs.get('create', True) |             create = kwargs.get('create', True) | ||||||
|  |  | ||||||
|  |             # Prevent creation of new settings objects when importing data | ||||||
|  |             if InvenTree.ready.isImportingData() or not InvenTree.ready.canAppAccessDatabase(allow_test=True): | ||||||
|  |                 create = False | ||||||
|  |  | ||||||
|             if create: |             if create: | ||||||
|                 # Attempt to create a new settings object |                 # Attempt to create a new settings object | ||||||
|                 setting = cls( |                 setting = cls( | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user