Resolves issue 156.
This commit is contained in:
parent
695317e699
commit
0cff54f136
1 changed files with 6 additions and 6 deletions
|
|
@ -178,6 +178,12 @@ def create_script(typeclass, key=None, obj=None, locks=None, autostart=True):
|
|||
else:
|
||||
new_script.key = "#%i" % new_db_object.id
|
||||
|
||||
if obj:
|
||||
try:
|
||||
new_script.obj = obj
|
||||
except ValueError:
|
||||
new_script.obj = obj.dbobj
|
||||
|
||||
# call the hook method. This is where all at_creation
|
||||
# customization happens as the typeclass stores custom
|
||||
# things on its database object.
|
||||
|
|
@ -190,12 +196,6 @@ def create_script(typeclass, key=None, obj=None, locks=None, autostart=True):
|
|||
if locks:
|
||||
new_script.locks.add(locks)
|
||||
|
||||
if obj:
|
||||
try:
|
||||
new_script.obj = obj
|
||||
except ValueError:
|
||||
new_script.obj = obj.dbobj
|
||||
|
||||
# a new created script should usually be started.
|
||||
if autostart:
|
||||
new_script.start()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue