diff --git a/archilance/settings/base.py b/archilance/settings/base.py index 670ed41..e31c42a 100644 --- a/archilance/settings/base.py +++ b/archilance/settings/base.py @@ -12,7 +12,7 @@ SECRET_KEY = 'vb6@b9zj7^f!^+x*e8=e!oundyu1!e*&0i(3gu2xwo4%fx4h&n' # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True -TEMPLATE_DEBUG = True # Show debug info in templates. See `projects/templates/project_filter.html` +TEMPLATE_DEBUG = False # Show debug info in templates. See `projects/templates/project_filter.html` ALLOWED_HOSTS = [] diff --git a/projects/forms.py b/projects/forms.py index e198a85..ebeb6e5 100644 --- a/projects/forms.py +++ b/projects/forms.py @@ -173,7 +173,7 @@ class RealtyForm(forms.ModelForm): if self.data.get('extra_fields'): raise forms.ValidationError('Это поле обязательно') else: - if not self.instance.pk: + if self.instance.pk: name = self.instance.name else: name = 'Новый объект %s' % util.random_ident(length=20) diff --git a/projects/templates/project_detail.html b/projects/templates/project_detail.html index 91bb37f..ae48616 100644 --- a/projects/templates/project_detail.html +++ b/projects/templates/project_detail.html @@ -101,7 +101,7 @@

- {{ project.text }} + {{ project.text|linebreaksbr }}

diff --git a/projects/templates/project_filter.html b/projects/templates/project_filter.html index 07aa6af..36aec07 100644 --- a/projects/templates/project_filter.html +++ b/projects/templates/project_filter.html @@ -76,7 +76,7 @@
-

Расширенный поиск

+

Расширенные поля

@@ -184,7 +184,7 @@ Объект "{{ proj.realty.name }}" -

{{ proj.text }}

+

{{ proj.text|linebreaksbr|truncatechars:300 }}

{% if TEMPLATE_DEBUG %}