mirror of
https://github.com/ansible/awx.git
synced 2026-01-22 15:08:03 -03:30
AC-647 Move django.db.models.Model import to (hopefully) prevent traceback.
This commit is contained in:
parent
1b224f64ac
commit
3d11f604a9
@ -10,9 +10,6 @@ import subprocess
|
||||
import sys
|
||||
import urlparse
|
||||
|
||||
# Django
|
||||
from django.db.models import Model
|
||||
|
||||
# Django REST Framework
|
||||
from rest_framework.exceptions import ParseError, PermissionDenied
|
||||
|
||||
@ -228,6 +225,7 @@ def model_instance_diff(old, new):
|
||||
Calculate the differences between two model instances. One of the instances may be None (i.e., a newly
|
||||
created model or deleted model). This will cause all fields with a value to have changed (from None).
|
||||
"""
|
||||
from django.db.models import Model
|
||||
if not(old is None or isinstance(old, Model)):
|
||||
raise TypeError('The supplied old instance is not a valid model instance.')
|
||||
if not(new is None or isinstance(new, Model)):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user