X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/9c5d9a4e77a10b4e60d89d3890e49002bd7f3993..2b96b3e346a68d086568c8fc57c1df455105c062:/apps/newtagging/admin.py diff --git a/apps/newtagging/admin.py b/apps/newtagging/admin.py index a8f511058..57a76d5d4 100644 --- a/apps/newtagging/admin.py +++ b/apps/newtagging/admin.py @@ -15,7 +15,7 @@ class FilteredSelectMultiple(forms.SelectMultiple): def _media(self): from django.conf import settings js = ['js/SelectBox.js' , 'js/SelectFilter2.js'] - return forms.Media(js=['%s%s' % (settings.ADMIN_MEDIA_PREFIX, url) for url in js]) + return forms.Media(js=['%sadmin/%s' % (settings.STATIC_URL, url) for url in js]) media = property(_media) def __init__(self, verbose_name, is_stacked, attrs=None, choices=()): @@ -30,12 +30,12 @@ class FilteredSelectMultiple(forms.SelectMultiple): # TODO: "id_" is hard-coded here. This should instead use the correct # API to determine the ID dynamically. output.append(u'SelectFilter.init("id_%s", "%s", %s, "%s"); });\n' % \ - (name, self.verbose_name.replace('"', '\\"'), int(self.is_stacked), settings.ADMIN_MEDIA_PREFIX)) + (name, self.verbose_name.replace('"', '\\"'), int(self.is_stacked), settings.STATIC_URL + "admin/")) return mark_safe(u''.join(output)) class TaggableModelForm(forms.ModelForm): - tags = forms.MultipleChoiceField(label=_('tags').capitalize(), required=True, widget=FilteredSelectMultiple(_('tags'), False)) + tags = forms.MultipleChoiceField(label=_('tags').capitalize(), required=False, widget=FilteredSelectMultiple(_('tags'), False)) def __init__(self, *args, **kwargs): if 'instance' in kwargs: