mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-19 22:42:17 +00:00
Fixed bug with versioning interface when related objects are deleted
This commit is contained in:
@@ -92,9 +92,16 @@ def model_compare(oldObj, newObj, excluded_keys=[]):
|
|||||||
if name in excluded_keys:
|
if name in excluded_keys:
|
||||||
continue # if we're excluding this field, skip over it
|
continue # if we're excluding this field, skip over it
|
||||||
|
|
||||||
oldValue = getattr(oldObj, name, None)
|
try:
|
||||||
newValue = getattr(newObj, name, None)
|
oldValue = getattr(oldObj, name, None)
|
||||||
|
except ObjectDoesNotExist:
|
||||||
|
oldValue = None
|
||||||
|
|
||||||
|
try:
|
||||||
|
newValue = getattr(newObj, name, None)
|
||||||
|
except ObjectDoesNotExist:
|
||||||
|
newValue = None
|
||||||
|
|
||||||
try:
|
try:
|
||||||
bothBlank = (not oldValue) and (not newValue)
|
bothBlank = (not oldValue) and (not newValue)
|
||||||
if oldValue != newValue and not bothBlank:
|
if oldValue != newValue and not bothBlank:
|
||||||
|
|||||||
Reference in New Issue
Block a user