Skip to content

Commit 10d54fc

Browse files
committed
remove compat module entirely
1 parent 5046a3a commit 10d54fc

File tree

8 files changed

+10
-33
lines changed

8 files changed

+10
-33
lines changed

admin_interface/admin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from django.contrib import admin
2+
from django.utils.translation import gettext_lazy as _
23

3-
from admin_interface.compat import gettext_lazy as _
44
from admin_interface.models import Theme
55

66

admin_interface/apps.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from django.apps import AppConfig
22
from django.db.models.signals import post_migrate
3-
4-
from admin_interface.compat import gettext_lazy as _
3+
from django.utils.translation import gettext_lazy as _
54

65

76
class AdminInterfaceConfig(AppConfig):

admin_interface/compat.py

Lines changed: 0 additions & 12 deletions
This file was deleted.

admin_interface/migrations/0021_file_extension_validator.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@
22

33
from __future__ import unicode_literals
44

5+
from django.core.validators import FileExtensionValidator
56
from django.db import migrations, models
67

7-
from admin_interface.compat import FileExtensionValidator
8-
98

109
class Migration(migrations.Migration):
1110

admin_interface/models.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
from colorfield.fields import ColorField
2+
from django.core.validators import FileExtensionValidator
23
from django.db import models
34
from django.db.models.signals import post_delete, post_save, pre_save
4-
from six import python_2_unicode_compatible
5+
from django.utils.encoding import force_str
6+
from django.utils.translation import gettext_lazy as _
57

6-
from admin_interface.cache import del_cached_active_theme
7-
from admin_interface.compat import FileExtensionValidator, force_str
8-
from admin_interface.compat import gettext_lazy as _
8+
from .cache import del_cached_active_theme
99

1010

11-
@python_2_unicode_compatible
1211
class Theme(models.Model):
1312
@staticmethod
1413
def post_migrate_handler(**kwargs):

admin_interface/static/admin/js/popup_response.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,7 @@
4242
if (typeof(openerRef.dismissAddRelatedObjectPopup) === 'function') {
4343
openerRef.dismissAddRelatedObjectPopup(windowRef, initData.value, initData.obj);
4444
}
45-
else if (typeof(openerRef.dismissAddAnotherPopup) === 'function') {
46-
// django 1.7 compatibility
47-
openerRef.dismissAddAnotherPopup(windowRef, initData.value, initData.obj);
48-
}
4945
break;
5046
}
5147

52-
})();
48+
})();

admin_interface/static/admin_interface/related-modal/related-modal.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ if (typeof(django) !== 'undefined' && typeof(django.jQuery) !== 'undefined')
7070
}
7171
}
7272

73-
// fix for django 1.7
73+
// fix for django 1.7 TODO remove
7474
if (iframeSrc.indexOf('_popup=1') === -1) {
7575
if (iframeSrc.indexOf('?') === -1) {
7676
iframeSrc += '?_popup=1';
@@ -135,10 +135,6 @@ if (typeof(django) !== 'undefined' && typeof(django.jQuery) !== 'undefined')
135135
window.presentRelatedObjectModal = presentRelatedObjectModal;
136136
window.presentRelatedObjectModalOnClickOn = presentRelatedObjectModalOnClickOn;
137137

138-
// django 1.7 compatibility
139-
presentRelatedObjectModalOnClickOn('a.add-another');
140-
141-
// django 1.8 and above
142138
presentRelatedObjectModalOnClickOn('a.related-widget-wrapper-link');
143139

144140
// raw_id_fields support

admin_interface/templatetags/admin_interface_tags.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
from django import template
55
from django.conf import settings
66
from django.template.loader import get_template
7+
from django.urls import NoReverseMatch, reverse
78
from django.utils import translation
89

910
from admin_interface.cache import get_cached_active_theme, set_cached_active_theme
10-
from admin_interface.compat import NoReverseMatch, reverse
1111
from admin_interface.models import Theme
1212
from admin_interface.version import __version__
1313

0 commit comments

Comments
 (0)