mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-27 10:22:17 +00:00
Another stab at resolving weird null error ref #537
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
import logging
|
||||||
from diff_match_patch import diff_match_patch
|
from diff_match_patch import diff_match_patch
|
||||||
from django.contrib.contenttypes.models import ContentType
|
from django.contrib.contenttypes.models import ContentType
|
||||||
from django.core.exceptions import ObjectDoesNotExist
|
from django.core.exceptions import ObjectDoesNotExist
|
||||||
@@ -160,10 +161,9 @@ class ModelComparison:
|
|||||||
# Build some dicts of what we have
|
# Build some dicts of what we have
|
||||||
item_dict = {} # build a list of items, key is the item_pk
|
item_dict = {} # build a list of items, key is the item_pk
|
||||||
for version in old_item_versions: # put all the old versions in a list
|
for version in old_item_versions: # put all the old versions in a list
|
||||||
old = version._object_version.object
|
if version is None or version._object_version is None:
|
||||||
if old is None:
|
logging.warning(f"Something was null when it really shouldn't be! {old_item_versions}")
|
||||||
pass
|
compare = ModelComparison(old=version._object_version.object, **comparisonParams)
|
||||||
compare = ModelComparison(old=old, **comparisonParams)
|
|
||||||
item_dict[version.object_id] = compare
|
item_dict[version.object_id] = compare
|
||||||
|
|
||||||
for version in new_item_versions: # go through the new versions
|
for version in new_item_versions: # go through the new versions
|
||||||
|
|||||||
Reference in New Issue
Block a user