Reverted int/long change, as Django's BigIntegerField can produce longs on Python 2

This commit is contained in:
Diederik van der Boor
2017-07-10 10:57:07 +02:00
parent e5d21d7b4e
commit 67dd5c0a0d
+7 -2
View File
@@ -1,6 +1,7 @@
"""
The parent admin displays the list view of the base model.
"""
import sys
import warnings
import django
@@ -21,6 +22,10 @@ from django.utils.translation import ugettext_lazy as _
from .forms import PolymorphicModelChoiceForm
if sys.version_info[0] >= 3:
long = int
class RegistrationClosed(RuntimeError):
"The admin model can't be registered anymore at this point."
@@ -315,9 +320,9 @@ class PolymorphicParentModelAdmin(admin.ModelAdmin):
try:
pos = path.find('/')
if pos == -1:
object_id = int(path)
object_id = long(path)
else:
object_id = int(path[0:pos])
object_id = long(path[0:pos])
except ValueError:
raise Http404("No ct_id parameter, unable to find admin subclass for path '{0}'.".format(path))