diff --git a/src/callback/admin.py b/src/callback/admin.py index d4be419..881cb86 100644 --- a/src/callback/admin.py +++ b/src/callback/admin.py @@ -10,6 +10,8 @@ def user_name(obj): return obj.user.email else: return None + + user_name.short_description = 'email' @@ -20,4 +22,3 @@ class ReqAvailAdmin(admin.ModelAdmin): admin.site.register(ReqAvail, ReqAvailAdmin) - diff --git a/src/callback/apps.py b/src/callback/apps.py index 235138d..67d74de 100644 --- a/src/callback/apps.py +++ b/src/callback/apps.py @@ -5,4 +5,3 @@ from django.apps import AppConfig class CallbackConfig(AppConfig): name = 'callback' verbose_name = 'Обращения' - diff --git a/src/callback/forms.py b/src/callback/forms.py index 367aada..c17ba04 100644 --- a/src/callback/forms.py +++ b/src/callback/forms.py @@ -22,12 +22,13 @@ class ReqAvailForm(forms.ModelForm): def clean(self): cleaned_data = super(ReqAvailForm, self).clean() - if (cleaned_data.get('name') and cleaned_data.get('message') and cleaned_data.get('phone')) and not(cleaned_data.get('captcha')): + if (cleaned_data.get('name') and cleaned_data.get('message') and + cleaned_data.get('phone')) and not(cleaned_data.get('captcha')): raise forms.ValidationError(u"Проверьте правильность кода проверки") - elif not (cleaned_data.get('name') and cleaned_data.get('message') and cleaned_data.get('phone') and cleaned_data.get('captcha')): + elif not (cleaned_data.get('name') and cleaned_data.get('message') and + cleaned_data.get('phone') and cleaned_data.get('captcha')): if self.errors.get('phone') and self.data.get('phone'): raise forms.ValidationError(u"Проверьте правильность ввода контактов") else: raise forms.ValidationError(u"Заполните все поля") return cleaned_data - diff --git a/src/callback/models.py b/src/callback/models.py index 073bb35..cabd2a5 100644 --- a/src/callback/models.py +++ b/src/callback/models.py @@ -1,6 +1,4 @@ # -*- coding: utf-8 -*- -import os.path - from django.conf import settings from django.db import models @@ -29,7 +27,7 @@ class ReqAvail(models.Model): class Meta: verbose_name = u'Обратная связь' verbose_name_plural = u'Обратная связь' - ordering = ['-created_at',] + ordering = ['-created_at'] def __unicode__(self): return u'Сообщение %s от %s' % (