From 2aca1e2b140db1d2fb3667ab287ee1a27b60102e Mon Sep 17 00:00:00 2001 From: Alexander Burdeiny Date: Thu, 7 Jul 2016 13:39:38 +0300 Subject: [PATCH] =?UTF-8?q?1454:=20=D0=AD=D1=82=D0=B0=D0=BF=20=E2=84=965:?= =?UTF-8?q?=20=D0=90=D0=B4=D0=BC=D0=B8=D0=BD=D0=BA=D0=B0=20=D0=B1=D0=B0?= =?UTF-8?q?=D0=B3=D0=B8=20-=20=D0=9D=D0=BE=D0=B2=D0=BE=D1=81=D1=82=D0=B8?= =?UTF-8?q?=20=D0=BA=20=D0=9A=D0=BE=D0=BD=D1=84=D0=B5=D1=80=D0=B5=D0=BD?= =?UTF-8?q?=D1=86=D0=B8=D1=8F=D0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- article/admin_urls.py | 9 +++- conference/admin.py | 7 +++- exposition/admin.py | 6 ++- fabfile.py | 3 -- .../admin/article/article_admin_list.html | 2 +- templates/admin/article/blog_form.html | 42 +++++++++++++++++-- 6 files changed, 59 insertions(+), 10 deletions(-) diff --git a/article/admin_urls.py b/article/admin_urls.py index 5e503b45..1c45f6b0 100644 --- a/article/admin_urls.py +++ b/article/admin_urls.py @@ -6,11 +6,18 @@ urlpatterns = patterns('article.admin', url(r'^blog/all/$', BlogList.as_view()), url(r'^news/all/$', NewsList.as_view()), - url(r'^delete/(?P.*)/$', ArticleDeleteView.as_view()), + # create url(r'^blog/$', BlogView.as_view()), url(r'^news/$', NewsView.as_view()), + # edit url(r'^blog/(?P.*)/$', BlogView.as_view()), url(r'^news/(?P.*)/$', NewsView.as_view()), + + # delete + url(r'^article/(?P.*)/delete/$', ArticleDeleteView.as_view()), + + # copy + #!FIXME whether it is necessary? ) diff --git a/conference/admin.py b/conference/admin.py index fdbea666..e46af6b1 100644 --- a/conference/admin.py +++ b/conference/admin.py @@ -322,7 +322,12 @@ def search_conf(request): qs = SearchQuerySet().models(Conference).order_by('text')[:30] else: qs = SearchQuerySet().models(Conference).autocomplete(content_auto=term).order_by('text')[:30] - result = [{'id': item.pk, 'label': get_by_lang(item, 'name', lang)} for item in qs] + + result = [] + for item in qs: + label = get_by_lang(item, 'name', lang) + if label: + result.append({'id': item.pk, 'label': label}) return HttpResponse(json.dumps(result), content_type='application/json') diff --git a/exposition/admin.py b/exposition/admin.py index 211f2b5f..f12f1479 100644 --- a/exposition/admin.py +++ b/exposition/admin.py @@ -366,7 +366,11 @@ def search_expo(request): qs = SearchQuerySet().models(Exposition).order_by('text')[:30] else: qs = SearchQuerySet().models(Exposition).autocomplete(content_auto=term).order_by('text')[:30] - result = [{'id': item.pk, 'label': get_by_lang(item, 'name', lang)} for item in qs] + result = [] + for item in qs: + label = get_by_lang(item, 'name', lang) + if label: + result.append({'id': item.pk, 'label': label}) return HttpResponse(json.dumps(result), content_type='application/json') diff --git a/fabfile.py b/fabfile.py index 089d81c6..6135dfb2 100644 --- a/fabfile.py +++ b/fabfile.py @@ -128,9 +128,6 @@ def t1451(): with cd(REMOTE_HOME_DIR): run('python manage.py migrate expobanner') - rc('banner_log_update_old') - rc('banner_log_update') - register_command('banner_log_update_old') register_command('banner_log_update') diff --git a/templates/admin/article/article_admin_list.html b/templates/admin/article/article_admin_list.html index 285aeb12..e8ba4d12 100644 --- a/templates/admin/article/article_admin_list.html +++ b/templates/admin/article/article_admin_list.html @@ -43,7 +43,7 @@ - + {% trans "Удалить" %} diff --git a/templates/admin/article/blog_form.html b/templates/admin/article/blog_form.html index f95d1974..f6670569 100644 --- a/templates/admin/article/blog_form.html +++ b/templates/admin/article/blog_form.html @@ -182,8 +182,9 @@