X-Git-Url: https://git.mdrn.pl/prawokultury.git/blobdiff_plain/891a1e056e6066b28e000df16d69b21946338a57..a84463e418ebe210f8c0ae2f466ad268d31e4c36:/migdal/forms.py?ds=sidebyside diff --git a/migdal/forms.py b/migdal/forms.py old mode 100755 new mode 100644 index 5a9d5d0..e7d6394 --- a/migdal/forms.py +++ b/migdal/forms.py @@ -5,8 +5,8 @@ from django import forms from django.utils.translation import ugettext_lazy as _, get_language from migdal.models import Entry -from migdal.settings import TYPE_SUBMIT -from slughifi import slughifi +from migdal import app_settings +from fnpdjango.utils.text import slughifi from django.core.mail import mail_managers from django import template @@ -23,12 +23,16 @@ def get_submit_form(*args, **kwargs): def __init__(self, *args, **kwargs): super(SubmitForm, self).__init__(*args, **kwargs) - self.fields['title_%s' % lang].required = True - self.fields['lead_%s' % lang].required = True + title = self.fields['title_%s' % lang] + title.required = True + title.label = _('Title') + lead = self.fields['lead_%s' % lang] + lead.required = True + lead.label = _('Content') def clean(self): data = super(SubmitForm, self).clean() - data['type'] = TYPE_SUBMIT + data['type'] = app_settings.TYPE_SUBMIT orig_slug = slughifi(data.get('title_%s' % lang, '')) slug = orig_slug number = 2