--- a/server/schemahooks.py Wed Dec 16 09:11:41 2009 +0100
+++ b/server/schemahooks.py Thu Dec 17 16:17:57 2009 +0100
@@ -974,10 +974,11 @@
"""check name change, handle final"""
check_valid_changes(session, entity, ro_attrs=('final',))
# don't use getattr(entity, attr), we would get the modified value if any
- oldname, newname = entity_oldnewvalue(entity, 'name')
- if newname.lower() != oldname.lower():
- SourceDbCWETypeRename(session, oldname=oldname, newname=newname)
- MemSchemaCWETypeRename(session, oldname=oldname, newname=newname)
+ if 'name' in entity.edited_attributes:
+ oldname, newname = entity_oldnewvalue(entity, 'name')
+ if newname.lower() != oldname.lower():
+ SourceDbCWETypeRename(session, oldname=oldname, newname=newname)
+ MemSchemaCWETypeRename(session, oldname=oldname, newname=newname)
def before_update_ertype(session, entity):
"""check name change, handle final"""