If system_init_done is not finished, allow inserts with id for any objects.

This commit is contained in:
Martin Edenhofer 2015-02-15 13:54:28 +01:00
parent 8f3fc50ce6
commit eaf537017e

View file

@ -44,7 +44,7 @@ class ApplicationModel < ActiveRecord::Base
@@import_class_list = ['Ticket', 'Ticket::Article', 'History', 'Ticket::State', 'Ticket::StateType', 'Ticket::Priority', 'Group', 'User', 'Role' ]
def check_attributes_protected
if ( !Setting.get('system_init_done') || Setting.get('import_mode')) && @@import_class_list.include?( self.class.to_s )
if !Setting.get('system_init_done') || ( Setting.get('import_mode') && @@import_class_list.include?( self.class.to_s ) )
# do noting, use id as it is
else
self[:id] = nil