diff --git a/AuthApp/forms.py b/AuthApp/forms.py index c66debf..498fa5a 100644 --- a/AuthApp/forms.py +++ b/AuthApp/forms.py @@ -34,9 +34,9 @@ class RegistrationForm(forms.Form): i = 0 names = list(cleaned_data.keys()) while i < len(names): - # for name, val in cleaned_data.items(): if not cleaned_data[names[i]]: - self.add_error(names[i], _('Обязательное поле')) + if self.fields[names[i]].required: + self.add_error(names[i], _('Обязательное поле')) i += 1 if cleaned_data and 'confirm_password' in cleaned_data and 'password' in cleaned_data: diff --git a/templates/widgets/w_message.html b/templates/widgets/w_message.html index b7a32b0..d5244aa 100644 --- a/templates/widgets/w_message.html +++ b/templates/widgets/w_message.html @@ -8,15 +8,8 @@
- {% if msg.text %} - - {{ msg.text }} - - {% elif ticket %} - - {{ ticket.text }} - - {% elif msg.files %} + + {% if msg.files %} {% for file in msg.files %}
@@ -29,6 +22,15 @@
{% endfor %} + + {% elif msg.text %} + + {{ msg.text }} + + {% elif ticket and ticket.text %} + + {{ ticket.text }} + {% endif %}