mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-21 23:42:14 +00:00
Fixed deleted event errors
This commit is contained in:
@@ -87,7 +87,7 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
|
||||||
{% include 'RIGS/object_button.html' with object=version.current %}
|
{% include 'RIGS/object_button.html' with object=version.new %}
|
||||||
</small>
|
</small>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -66,7 +66,7 @@
|
|||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{ version.revision.date_created }}</td>
|
<td>{{ version.revision.date_created }}</td>
|
||||||
<td><a href="{{ version.current.get_absolute_url }}">{{version.current|to_class_name}} {{ version.new.pk|stringformat:"05d" }}</a></td>
|
<td><a href="{{ version.new.get_absolute_url }}">{{version.new|to_class_name}} {{ version.new.pk|stringformat:"05d" }}</a></td>
|
||||||
<td>{{ version.version.pk }}|{{ version.revision.pk }}</td>
|
<td>{{ version.version.pk }}|{{ version.revision.pk }}</td>
|
||||||
<td>{{ version.revision.user.name }}</td>
|
<td>{{ version.revision.user.name }}</td>
|
||||||
<td>
|
<td>
|
||||||
|
|||||||
@@ -41,12 +41,13 @@ def model_compare(oldObj, newObj, excluded_keys=[]):
|
|||||||
|
|
||||||
for thisField in theFields:
|
for thisField in theFields:
|
||||||
name = thisField.name
|
name = thisField.name
|
||||||
oldValue = getattr(oldObj, name, None)
|
|
||||||
newValue = getattr(newObj, name, None)
|
|
||||||
|
|
||||||
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)
|
||||||
|
newValue = getattr(newObj, name, 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:
|
||||||
@@ -129,7 +130,7 @@ def get_changes_for_version(newVersion, oldVersion=None):
|
|||||||
compare = {}
|
compare = {}
|
||||||
compare['revision'] = newVersion.revision
|
compare['revision'] = newVersion.revision
|
||||||
compare['new'] = newVersion.object_version.object
|
compare['new'] = newVersion.object_version.object
|
||||||
compare['current'] = modelClass.objects.get(pk=compare['new'].pk)
|
compare['current'] = modelClass.objects.filter(pk=compare['new'].pk).first()
|
||||||
compare['version'] = newVersion
|
compare['version'] = newVersion
|
||||||
|
|
||||||
if oldVersion:
|
if oldVersion:
|
||||||
|
|||||||
Reference in New Issue
Block a user