Fixed a database referene bug that would remove ForeignKey referenced objects when reverse referenced through something like db_home (this defaults to CASCADE mode, is now SET_NULL). Also fixed some other minor things.

This commit is contained in:
Griatch 2014-04-20 15:03:53 +02:00
parent 787f93c4c0
commit 7d0ff9c71c
4 changed files with 12 additions and 17 deletions

View file

@ -170,7 +170,6 @@ def create_object(typeclass=None, key=None, location=None,
if aliases:
new_object.aliases.add(aliases)
# perform a move_to in order to display eventual messages.
if home:
new_object.home = home
else:
@ -182,6 +181,7 @@ def create_object(typeclass=None, key=None, location=None,
raise _ObjectDB.DoesNotExist("CHARACTER_DEFAULT_HOME (= '%s') does not exist, or the setting is malformed." %
settings.CHARACTER_DEFAULT_HOME)
# perform a move_to in order to display eventual messages.
if location:
new_object.move_to(location, quiet=True)
else: