remotes/origin/1203
Kotiuk Nazarii 11 years ago
commit 316767f29e
  1. 3
      article/forms.py
  2. 1
      article/models.py
  3. 11
      city/forms.py
  4. 4
      city/models.py
  5. 3
      conference/forms.py
  6. 11
      conference/views.py
  7. 3
      country/forms.py
  8. 3
      country/models.py
  9. 6
      exposition/forms.py
  10. 3
      functions/signal_handlers.py
  11. 1
      import_xls/excel_settings.py
  12. 9
      place_exposition/forms.py
  13. 8
      proj/admin.py
  14. 3
      proj/admin_urls.py
  15. 6
      proj/urls.py
  16. 6
      proj/views.py
  17. 4
      settings/old_urls.py
  18. 38
      settings/redirect_views.py
  19. 1
      templates/admin/includes/staff_nav.html
  20. 31
      templates/client/404.html
  21. 18
      templates/client/404_test.html
  22. 3
      templates/client/popups/user_information.html
  23. 97
      templates/client/static_client/css/main.css
  24. 2
      templates/client/static_client/css_min/main.min.css
  25. 13
      templates/client/static_client/js/_modules/block.common.js
  26. 14
      templates/client/static_client/js/_modules/block.registration.completion.js
  27. 2
      templates/client/static_client/js_min/_modules/block.common.min.js
  28. 2
      templates/client/static_client/js_min/_modules/block.registration.completion.min.js
  29. 7
      theme/forms.py
  30. 2
      theme/models.py

@ -186,7 +186,8 @@ class ArticleForm(forms.Form):
article.user = User.objects.get(id=data['author'].id)#.id cause select uses queryset
#create slug field from russian language
article.url = translit_with_separator(data['main_title_ru'].strip()).lower()
if not getattr(article, 'slug'):
article.slug = translit_with_separator(data['main_title_ru'].strip()).lower()
# fill translated fields and save object
fill_with_signal(Article, article, data)

@ -264,4 +264,5 @@ class Article(TranslatableModel):
from django.db.models.signals import post_save
from functions.signal_handlers import post_save_handler
post_save.connect(post_save_handler, sender=Article)

@ -84,6 +84,9 @@ class CityForm(forms.Form):
else:
city = City()
if not getattr(city, 'url'):
city.url = translit_with_separator(data['name_ru'].strip()).lower()
city.phone_code = data['phone_code']
city.population = data.get('population')
city.inflect = data['inflect']
@ -95,14 +98,6 @@ class CityForm(forms.Form):
city.country = data['country']# .id cause select uses queryset
#city.country = Country.objects.get(id=data['country'].id)# .id cause select uses queryset
# url generate for city: "country_name-city_name"
#if data.get('name_en'):
#city.url = '%s-'%translit_with_separator(city.country.name) + translit_with_separator(data['name_en']).lower()
#else:
#city.url = '%s-'%translit_with_separator(city.country.name) + translit_with_separator(data['name_ru']).lower()
#city.url = '%s'%translit_with_separator(data['name_ru'].strip()).lower()
#city.save()
# fill translated fields and save object
fill_with_signal(City, city, data)

@ -16,7 +16,7 @@ from seminar.models import Seminar
from webinar.models import Webinar
# custom functions
from functions.db import db_table_exists
from functions.signal_handlers import post_save_handler
from functions.signal_handlers import post_save_handler, pre_save_handler
from functions.models_methods import ExpoManager, CityManager
#check if table exist and create flags if true
@ -134,5 +134,7 @@ class Hotel(TranslatableModel):
address = models.CharField(max_length=255, blank=True)
)
pre_save.connect(pre_save_handler, sender=City)
post_save.connect(post_save_handler, sender=City)
post_save.connect(post_save_handler, sender=Hotel)

@ -135,7 +135,8 @@ class ConferenceCreateForm(forms.Form):
conference.tag.clear()
#simple fields
conference.url = translit_with_separator(data['name_ru'].strip()).lower()
if not getattr(conference, 'url'):
conference.url = translit_with_separator(data['name_ru'].strip()).lower()
if data.get('logo'):
conference.logo = data['logo']

@ -345,6 +345,17 @@ class ConferenceDetail(JitterCacheMixin, DetailView):
slug_field = 'url'
template_name = 'client/conference/conference_detail.html'
def dispatch(self, request, *args, **kwargs):
slug = self.kwargs.get(self.slug_url_kwarg, None)
try:
city = City.objects.get(old_url=slug)
return HttpResponseRedirect('/conference/city/%s/'%city.url)
except City.DoesNotExist:
return super(ConferenceDetail, self).dispatch(request, *args, **kwargs)
def get_context_data(self, **kwargs):
context = super(ConferenceDetail, self).get_context_data(**kwargs)
context['advertising_form'] = AdvertiseForm()

@ -127,6 +127,9 @@ class CountryForm(forms.Form):
country.language.clear()
country.currency.clear()
if not getattr(country, 'url'):
country.url = translit_with_separator(data['name_ru'].strip()).lower()
country.population = data['population']
country.teritory = data['teritory']
country.timezone = data['timezone']

@ -2,7 +2,7 @@
from datetime import date
from django.db import models
from django.contrib.contenttypes import generic
from django.db.models.signals import post_save
from django.db.models.signals import post_save, pre_save
from hvad.models import TranslatableModel, TranslatedFields
from bitfield import BitField
from manager import CountryManager, AreaManager
@ -161,4 +161,5 @@ class Country(TranslatableModel):
pre_save.connect(pre_save_handler, sender=Country)
post_save.connect(post_save_handler, sender=Country)

@ -79,7 +79,7 @@ class ExpositionCreateForm(forms.Form):
widget=forms.CheckboxSelectMultiple())
#
currency = forms.ChoiceField(label=u'Валюта', choices=currencies, required=False)
application_deadline = forms.DateField(label=u'Срок подачи стенда', required=False)
application_deadline = forms.DateField(label=u'Срок подачи стенда',input_formats=['%Y-%m-%d', '%d.%m.%Y'], required=False)
min_stand_size = forms.CharField(label=u'Минимальный размер стенда', required=False)
price_catalog = forms.CharField(label=u'Цена за каталог', required=False)
@ -172,8 +172,8 @@ class ExpositionCreateForm(forms.Form):
exposition.company.clear()
#simple fields
exposition.url = translit_with_separator(data['name_ru'].strip()).lower()
if not getattr(exposition, 'url'):
exposition.url = translit_with_separator(data['name_ru'].strip()).lower()
if data.get('logo'):
exposition.logo = data['logo']

@ -5,6 +5,9 @@ from functions.form_check import translit_with_separator
def pre_save_handler(sender, **kwargs):
obj = kwargs['instance']
url = getattr(obj, 'url')
if url is not None:
return
if hasattr(obj, 'language_code') and obj.language_code =='en':
try:

@ -64,6 +64,7 @@ def get_quality(value, field):
place_settings=[
{'name': 'id', 'verbose_name': u'id', 'type': get_int, 'width':1500},
{'name': 'url', 'verbose_name': u'URL', 'type': unicode},
{'name': 'name', 'verbose_name': u'Название', 'type': unicode},
{'name': 'type', 'verbose_name': u'Тип', 'type': get_place_type},##########
{'name': 'main_title', 'verbose_name': u'Краткое описание', 'type': unicode},

@ -113,10 +113,11 @@ class ExpositionForm(forms.Form):
place_exposition = obj
#simple fields
if data.get('name_en'):
place_exposition.url = translit_with_separator(data['name_en'].strip()).lower()
else:
place_exposition.url = translit_with_separator(data['name_ru'].strip()).lower()
if not getattr(place_exposition, 'url'):
if data.get('name_en'):
place_exposition.url = translit_with_separator(data['name_en'].strip()).lower()
else:
place_exposition.url = translit_with_separator(data['name_ru'].strip()).lower()
if data.get('logo'):
place_exposition.logo = data['logo']
place_exposition.type = data['type']

@ -3,8 +3,7 @@ from django.shortcuts import render_to_response
from django.http import HttpResponseRedirect, HttpResponse, Http404
from django.contrib.contenttypes.models import ContentType
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.contrib.admin.views.decorators import staff_member_required
from django.views.generic import TemplateView
from file.models import TmpFile, FileModel
from file.forms import FileModelForm, FileForm
from city.models import City
@ -14,8 +13,9 @@ from django.db.models.loading import get_model
def admin_home(request):
return render_to_response('base.html')
class AdminIndex(TemplateView):
template_name = 'admin/base.html'
def ajax_city(request):
"""

@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
from django.conf.urls import patterns, include, url
from proj.admin import AdminIndex
from functions import required
from django.contrib.admin.views.decorators import staff_member_required
@ -8,7 +9,7 @@ from django.contrib.admin.views.decorators import staff_member_required
urlpatterns = required(
staff_member_required,
patterns('',
url(r'^$', 'proj.admin.admin_home'),
url(r'^$', AdminIndex.as_view()),
url(r'^', include('import_xls.admin_urls')),
url(r'^accounts/', include('accounts.admin_urls')),
url(r'^article/', include('article.admin_urls')),

@ -12,9 +12,6 @@ class Robot(TemplateView):
content_type = 'text/plain'
from django.contrib.sitemaps import Sitemap
from exposition.models import Exposition
from sitemaps import ExpoCard, ExpoCity, ExpoCountry, ExpoTheme, ExpoTag, ConfCard, ConfCity, ConfCountry, ConfTheme,\
ConfTag, NewsSiteMap, BlogsSiteMap, Additional, Important
@ -26,8 +23,11 @@ sitemaps = {
'conference_theme': ConfTheme(), 'conference_tag': ConfTag(), 'main': Important(), 'additional': Additional()
}
handler404 = 'proj.views.error404'
urlpatterns = patterns('',
#url(r'^__debug__/', include(debug_toolbar.urls)),
url(r'^sitemap-(?P<section>.+)\.xml$', views.sitemap, {'sitemaps': sitemaps}),
url(r'^admin/', include('proj.admin_urls')),
#url(r'^sitemap.xml$', 'django.contrib.sitemaps.views.sitemap', {'sitemaps': sitemaps}),
url(r'^sitemap\.xml$', views.index, {'sitemaps': sitemaps}),

@ -32,6 +32,12 @@ def expo_context(request):
cont.update({'search_form': ExpositionSearchForm()})
return cont
def error404(request):
context = {}
expo_themes = Theme.active.expo_themes_with_count()
conf_themes = Theme.active.conference_themes_with_count()
context.update({'expo_themes': expo_themes, 'conf_themes': conf_themes})
return render_to_response('client/404.html', context, context_instance=RequestContext(request))
class MainPageView(JitterCacheMixin,TemplateView):
cache_range = settings.CACHE_RANGE

@ -2,7 +2,7 @@
from django.conf.urls import patterns, include, url
from django.http import HttpResponse
from django.views.decorators.cache import cache_page
from redirect_views import old_redirect, old_profile
from redirect_views import old_redirect, old_profile, tag_redirect
def test(request):
return HttpResponse('test')
@ -148,7 +148,7 @@ urlpatterns = patterns('',
url(r'^tags.php/theme/(?P<tag>.*)/page/(?P<page>\d+)/$', old_redirect, {'redirect_url': '/expo/tag/{tag}/'}),
url(r'^tags.php/theme/(?P<tag>.*)/$', old_redirect, {'redirect_url': '/expo/tag/{tag}/'}),
url(r'^tag/(?P<tag>.*)/page/(?P<page>\d+)/$', old_redirect, {'redirect_url': '/expo/tag/{tag}/page/{page}/'}),
url(r'^tag/(?P<tag>.*)/$', old_redirect, {'redirect_url': '/expo/tag/{tag}/'}),
url(r'^tag/(?P<tag>.*)/$', tag_redirect, {'redirect_url': '/expo/tag/{tag}/'}),
url(r'^catalog/(?P<city>.*)/page/(?P<page>\d+)/$', old_redirect, {'redirect_url': '/expo/city/{city}/page/{page}/'}),

@ -37,6 +37,28 @@ class ThemeRedirect(RedirectMixin):
class TagRedirect(RedirectMixin):
model = Tag
def get_object_url(self, key, value):
Model = self.model
try:
obj = Model.objects.get(old_url=value)
except Model.DoesNotExist:
try:
obj = Model.objects.get(url=value)
except Model.DoesNotExist:
if value.endwith('-expo'):
value = value.replace('-expo', '')
elif value.endwith('-conf'):
value = value.replace('-conf', '')
obj = get_object_or_404(old_url=value)
if obj:
return {key: obj.url}
else:
raise Http404
class CompanyRedirect(RedirectMixin):
model = Company
@ -101,6 +123,22 @@ def old_redirect(request, *args, **kwargs):
redirect_obj = old_params[key]()
updates.update(redirect_obj.get_object_url(key, value))
params.update(updates)
redirect = redirect.format(**params)
return HttpResponsePermanentRedirect(redirect)
def tag_redirect(request, *args, **kwargs):
redirect = kwargs.get('redirect_url')
params = dict(kwargs)
tag = params.get('tag', '')
if tag.endswith('-conf'):
redirect = redirect.replace('expo', 'conference')
updates = {}
for key, value in params.iteritems():
if key in old_params:
redirect_obj = old_params[key]()
updates.update(redirect_obj.get_object_url(key, value))
params.update(updates)
redirect = redirect.format(**params)

@ -9,6 +9,7 @@
<li><a href="/admin/conference/all">Конференция</a></li>
<li><a href="/admin/seminar/all">Семинар</a></li>
<li><a href="/admin/webinar/all">Вебинар</a></li>
<li><a href="/admin/place_exposition/all">Место проведения выставки</a></li>
</ul>
</li>

@ -0,0 +1,31 @@
{% extends 'base_catalog.html' %}
{% block content_list %}
<div class="page-title">
<h1>Запрашиваемая страница не найдена</h1>
</div>
<div class="m-article error-404">
<span class="figure">404:</span>
<p class="title">Возможно у нее изменился адрес или же она была удалена.<br> Воспользуйтесь поиском по названию, расширенной формой поиска или каталогом событий.</p>
<div class="clearfix"></div>
<hr/>
<section>
<h2>Каталог выставок</h2>
<ul class="items-list">
{% for item in expo_themes %}
<li><i class="fa fa-circle"></i><a href="/expo/theme/{{ item.url }}/">{{ item.name }}&nbsp;({{ item.expo_count }})</a></li>
{% endfor %}
</ul>
</section>
<hr/>
<section >
<h2>Каталог конференций</h2>
<ul class="items-list">
{% for item in conf_themes %}
<li><i class="fa fa-circle"></i><a href="/conference/theme/{{ item.url }}/">{{ item.name }}&nbsp;({{ item.conference_count }})</a></li>
{% endfor %}
</ul>
</section>
</div>
{% endblock %}

@ -1,18 +0,0 @@
{% extends 'base_catalog.html' %}
{% block content_list %}
<ul>
{{ expo_themes }}
{{ a }}
{% for item in expo_themes %}
<li><a href="/expo/theme/{{ item.url }}/"></a></li>
{% endfor %}
</ul>
<ul>
{% for item in conf_themes %}
<li><a href="/conference/theme/{{ item.url }}/"></a></li>
{% endfor %}
</ul>
{% endblock %}

@ -77,9 +77,10 @@
<th>www.expomap.ru/</th>
<td class="input_bottom" colspan="3">
<div class="pwf-line">
<div class="pwf-field">
<div class="pwf-field url-field">
{{ form.url }}
</div>
<div class="hint-box">ivanova</div>
<div class="pwf-msg err-message-box"></div>
</div>

@ -13460,6 +13460,7 @@ hr + .rq-note {
/************************\
# completion of registration modal
# after registration form
\***********************/
.after-register-modal .pw-form .pwf-line{
@ -13510,7 +13511,37 @@ hr + .rq-note {
.after-register-modal .pwf-line .err-message-box{
margin-top: 4px;
}
.after-register-modal .pwf-line .hint-box{
display: none;
width: 62px;
position: absolute;
text-align: center;
margin-left: 31px;
padding: 8px 12px;
color: #000000;
background-color: #aaaaaa;
opacity:.6;
margin-top: -68px;
border-radius:4px;
}
.after-register-modal .pwf-line .err + .hint-box{
display: none !important;
}
.after-register-modal .pwf-line .hint-box:after{
top: 100%;
left: 50%;
border: solid transparent;
content: " ";
height: 0;
width: 0;
position: absolute;
pointer-events: none;
border-color: rgba(170, 170, 170, 0);
border-top-color: #aaaaaa;
border-width: 4px;
margin-left: -4px;
}
/************************\
# successful registration message
\***********************/
@ -13842,4 +13873,70 @@ hr + .rq-note {
\**************************/
.organizer-modal .organizer-name{
border-bottom: 1px solid #f26c2a;
}
/************************\
# 404 not found page
\***********************/
.error-404 .items-list{
-webkit-column-count: 3; /* Chrome, Safari, Opera */
-moz-column-count: 3; /* Firefox */
column-count: 3;
list-style-type: none;
list-style-position: inside;
margin: 0;
display: block;
}
.error-404 .items-list li{
margin-bottom: 8px;
display: block;
position: relative;
}
/*.error-404 .items-list li:before{*/
/*float: left;*/
/*content: "\2022";*/
/*}*/
.error-404 .items-list .fa{
display: block;
float: left;
font-size: 6px;
line-height: 16px;
}
.error-404 .items-list a{
display: block;
margin-left: 16px;
line-height: 1.2em;
-webkit-transition: all .3s;
-o-transition: all .3s;
transition: all .3s;
text-decoration: none;
color: #464646;
}
.error-404 .items-list a:hover{
color: #ff6600;
}
.error-404 .title{
font-size: 16px;
padding-top: 12px;
}
.error-404 h2{
color: #ff6600;
font-family: dindisplay_pro,sans-serif;
font-size: 30px;
line-height: 30px;
font-weight: normal;
}
.error-404 .figure{
display: block;
font-family: dindisplay_pro,sans-serif;
color: #f60;
float: left;
font-size: 96px;
margin-right: 22px;
line-height: 1em;
}

File diff suppressed because one or more lines are too long

@ -217,9 +217,13 @@ if (EXPO.common){
url = $form.attr('action'),
formData = $(this).serialize(),
method = $form.attr("method"),
$succesRegisterModal = $("#pw-reg-complete"),
$resend = $(".resend-letter", $succesRegisterModal),
mailVal = $.trim($('#id_email',$form).val()),
callback = function (data) {
if (data.success){
$.fancybox.close();
$(".error", $form).remove();
$(".required.err", $form).removeClass("required err");
@ -232,6 +236,10 @@ if (EXPO.common){
}
});
$resend.attr('data-email',mailVal);
$.fancybox.close(true);
$.fancybox('#pw-reg-complete');
}
else{
// delete previous error messages
@ -252,7 +260,8 @@ if (EXPO.common){
$input.parent().addClass('required err');
$msg.attr("data-default", $msg.text());
$msg.text('').prepend($error);
})
});
}
};
if(method == "post"){

@ -108,13 +108,15 @@ if (EXPO.registration.completion) {
var com = EXPO.common;
$(function () {
var $form = $('#end-reg-form');
$('body').addClass('body-fixed');
placeInput('100%');
$('#id_code_country').select2({
$('#id_code_country').val('7').select2({
width: '95px'
});
$.fancybox.open([
{
href: '#end-reg'
@ -137,12 +139,20 @@ if (EXPO.registration.completion) {
});
$('#end-reg-form').on('submit', function (e) {
$form.on('submit', function (e) {
e.preventDefault();
var url = $(this).attr('action');
var formData = $(this).serialize();
$.post(url, formData, registrationSuccess)
});
$(".url-field:not(.err) input",$form).focusin(function () {
$(this).parent().siblings(".hint-box").fadeIn();
});
$(".url-field:not(err) input",$form).focusout(function () {
$(this).parent().siblings(".hint-box").fadeOut();
});
});

File diff suppressed because one or more lines are too long

@ -1 +1 @@
var EXPO=EXPO||{};EXPO.registration=EXPO.registration||{},EXPO.registration.completion?console.warn("WARNING: EXPO.registration..completion is already defined!"):EXPO.registration.completion=function(){var e={},t=function(e){var t=$("#end-reg"),o="pwf-line",i=EXPO.common.opt.activeClass,r="phone",n="label",a=EXPO.common.opt.errMessageClass;if($("."+a,t).removeClass(i),e.success)location=e.redirect;else{console.log(e);for(var s in e.errors)e.errors.hasOwnProperty(s)&&($itemWrap=$("#id_"+s).closest("."+o),$("."+a,$itemWrap).addClass(i).text(e.errors[s][0]),$itemWrap.hasClass(r)&&$("."+n,$itemWrap).hide())}},o=function(e){$("#id_country").val("159").select2({placeholder:"Ваша страна",width:e}).on("change",function(){var e=$("option:selected",this).attr("data-phone-code");""!=$.trim(e)?$("#id_code_country").select2("val",e):$("#id_code_country").select2("val","")}),$("#id_city").select2({placeholder:"Ваш город",width:e,ajax:{url:"/city/get-city/",dataType:"json",quietMillis:200,data:function(e,t,o){var o=$("#id_country").val();return{term:e,page:t,country:o}},results:function(e){var t=[];return $.each(e,function(e,o){t.push({id:o.id,text:o.label})}),{results:t}}},initSelection:function(e,t){var o=$(e).val(),i=$(e).attr("data-init-text");t({id:o,text:i})}})};e.opt={};EXPO.common;return $(function(){$("body").addClass("body-fixed"),o("100%"),$("#id_code_country").select2({width:"95px"}),$.fancybox.open([{href:"#end-reg"}],{closeBtn:!1,closeClick:!1,modal:!0,scrolling:"no",helpers:{overlay:{closeClick:!1},locked:!0},keys:{close:null}}),$("#end-reg-form").on("submit",function(e){e.preventDefault();var o=$(this).attr("action"),i=$(this).serialize();$.post(o,i,t)})}),e.init=function(e){$.extend(this.opt,e)},e}();
var EXPO=EXPO||{};EXPO.registration=EXPO.registration||{},EXPO.registration.completion?console.warn("WARNING: EXPO.registration..completion is already defined!"):EXPO.registration.completion=function(){var t={},e=function(t){var e=$("#end-reg"),i="pwf-line",o=EXPO.common.opt.activeClass,n="phone",r="label",a=EXPO.common.opt.errMessageClass;if($("."+a,e).removeClass(o),t.success)location=t.redirect;else{console.log(t);for(var s in t.errors)t.errors.hasOwnProperty(s)&&($itemWrap=$("#id_"+s).closest("."+i),$("."+a,$itemWrap).addClass(o).text(t.errors[s][0]),$itemWrap.hasClass(n)&&$("."+r,$itemWrap).hide())}},i=function(t){$("#id_country").val("159").select2({placeholder:"Ваша страна",width:t}).on("change",function(){var t=$("option:selected",this).attr("data-phone-code");""!=$.trim(t)?$("#id_code_country").select2("val",t):$("#id_code_country").select2("val","")}),$("#id_city").select2({placeholder:"Ваш город",width:t,ajax:{url:"/city/get-city/",dataType:"json",quietMillis:200,data:function(t,e,i){var i=$("#id_country").val();return{term:t,page:e,country:i}},results:function(t){var e=[];return $.each(t,function(t,i){e.push({id:i.id,text:i.label})}),{results:e}}},initSelection:function(t,e){var i=$(t).val(),o=$(t).attr("data-init-text");e({id:i,text:o})}})};t.opt={};EXPO.common;return $(function(){var t=$("#end-reg-form");$("body").addClass("body-fixed"),i("100%"),$("#id_code_country").val("7").select2({width:"95px"}),$.fancybox.open([{href:"#end-reg"}],{closeBtn:!1,closeClick:!1,modal:!0,scrolling:"no",helpers:{overlay:{closeClick:!1},locked:!0},keys:{close:null}}),t.on("submit",function(t){t.preventDefault();var i=$(this).attr("action"),o=$(this).serialize();$.post(i,o,e)}),$(".url-field:not(.err) input",t).focusin(function(){$(this).parent().siblings(".hint-box").fadeIn()}),$(".url-field:not(err) input",t).focusout(function(){$(this).parent().siblings(".hint-box").fadeOut()})}),t.init=function(t){$.extend(this.opt,t)},t}();

@ -47,6 +47,10 @@ class ThemeForm(forms.Form):
else:
theme = Theme.objects.get(id=id)
if not getattr(theme, 'url'):
theme.url = translit_with_separator(data['name_ru'].strip()).lower()
#flag = 0
#for item in data['types']:
# flag = flag | getattr(Theme.types, item)
@ -109,6 +113,9 @@ class TagForm(forms.Form):
else:
tag = Tag.objects.get(id=id)
if not getattr(tag, 'url'):
tag.url = translit_with_separator(data['name_ru'].strip()).lower()
if data.get('theme'):
tag.theme = Theme.objects.get(id=data['theme'])

@ -237,7 +237,7 @@ def pre_save_handler(sender, **kwargs):
if not obj.url:
obj.url = ''.join([random.choice(string.ascii_lowercase) for n in xrange(8)])
#pre_save.connect(pre_save_handler, sender=Theme)
pre_save.connect(pre_save_handler, sender=Theme)
pre_save.connect(pre_save_handler, sender=Tag)
post_save.connect(post_save_handler, sender=Theme)

Loading…
Cancel
Save