Added version check for 1.7 to create context dict.

master
Brandon Taylor 2016-11-02 21:29:31 -04:00
parent 81f2faebc6
commit d1911519ed
1 changed files with 5 additions and 1 deletions

View File

@ -219,7 +219,11 @@ class SortableAdmin(SortableAdminBase, ModelAdmin):
except AttributeError: except AttributeError:
verbose_name_plural = opts.verbose_name_plural verbose_name_plural = opts.verbose_name_plural
if VERSION <= (1, 7):
context = {}
else:
context = self.admin_site.each_context(request) context = self.admin_site.each_context(request)
context.update({ context.update({
'title': u'Drag and drop {0} to change display order'.format( 'title': u'Drag and drop {0} to change display order'.format(
capfirst(verbose_name_plural)), capfirst(verbose_name_plural)),