From 0922746f5050a85ff461f3344d33736ec72a0f2a Mon Sep 17 00:00:00 2001 From: Ivlev Denis Date: Fri, 29 Jun 2018 08:29:21 +0300 Subject: [PATCH 1/4] Fix about page --- project/templates/lilcity/about.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/templates/lilcity/about.html b/project/templates/lilcity/about.html index 1a46b8e3..4411618e 100644 --- a/project/templates/lilcity/about.html +++ b/project/templates/lilcity/about.html @@ -1,4 +1,4 @@ -{% extends "templates/lilcity/index.html" %} {% load static %} {% block title %}О школе{% endblock title %} {% block content %} {% load static %} +{% extends "templates/lilcity/index.html" %} {% load static %} {% block title %}О школе{% endblock title %} {% block content %}
Date: Fri, 29 Jun 2018 16:38:03 +0300 Subject: [PATCH 2/4] Fix save avatar with cyrilyc fname --- apps/user/views.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/user/views.py b/apps/user/views.py index 257b8103..14ecef7b 100644 --- a/apps/user/views.py +++ b/apps/user/views.py @@ -2,6 +2,7 @@ import arrow from io import BytesIO from PIL import Image +from uuid import uuid4 from os.path import splitext from datetime import timedelta from paymentwall import Pingback @@ -224,6 +225,7 @@ class UserEditView(UpdateView): if ext == 'JPG': ext = 'JPEG' photo.save(buffer, ext) + fname = str(uuid4()) + '.' + ext.lower() self.object.photo.save(fname, buffer) buffer.close() if not request.POST._mutable: From 52d626c1cb836e8dee42c3471b3caffff8e08383 Mon Sep 17 00:00:00 2001 From: Ivlev Denis Date: Fri, 29 Jun 2018 16:57:17 +0300 Subject: [PATCH 3/4] Add ROISTAT_COUNTER_ID param to settings and .env file --- apps/config/templatetags/settings.py | 9 +++++++++ docker/.env.example | 1 + project/settings.py | 3 +++ project/templates/lilcity/index.html | 6 +++++- 4 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 apps/config/templatetags/settings.py diff --git a/apps/config/templatetags/settings.py b/apps/config/templatetags/settings.py new file mode 100644 index 00000000..57b6076c --- /dev/null +++ b/apps/config/templatetags/settings.py @@ -0,0 +1,9 @@ +from django import template +from django.conf import settings + +register = template.Library() + + +@register.simple_tag +def setting(setting): + return getattr(settings, setting, None) diff --git a/docker/.env.example b/docker/.env.example index afc3f744..bc750b18 100644 --- a/docker/.env.example +++ b/docker/.env.example @@ -19,3 +19,4 @@ PAYMENTWALL_APP_KEY=d6f02b90cf6b16220932f4037578aff7 PAYMENTWALL_SECRET_KEY=4ea515bf94e34cf28646c2e12a7b8707 MIXPANEL_TOKEN=79bd6bfd98667ed977737e6810b8abcd RAVEN_DSN=https://b545dac0ae0545a1bcfc443326fe5850:6f9c900cef7f4c11b63561030b37d15c@sentry.io/1197254 +ROISTAT_COUNTER_ID=09db30c750035ae3d70a41d5f10d59ec diff --git a/project/settings.py b/project/settings.py index 24ee180e..c9ef5dee 100644 --- a/project/settings.py +++ b/project/settings.py @@ -257,6 +257,9 @@ RAVEN_CONFIG = { 'release': raven.fetch_git_sha(BASE_DIR), } +# Roistat counter id +ROISTAT_COUNTER_ID = os.getenv('ROISTAT_COUNTER_ID', None) + INSTAGRAM_RESULTS_PATH = 'media/instagram/results/' DATA_UPLOAD_MAX_MEMORY_SIZE = 20242880 diff --git a/project/templates/lilcity/index.html b/project/templates/lilcity/index.html index 96efb4e2..b5f4ee6f 100644 --- a/project/templates/lilcity/index.html +++ b/project/templates/lilcity/index.html @@ -1,4 +1,5 @@ {% load static %} +{% import setting from settings %} @@ -73,7 +74,10 @@ var schoolAmountForDiscount = parseFloat({{ config.SERVICE_DISCOUNT_MIN_AMOUNT }}); {% comment %} ROISTAT {% endcomment %} - + {% block foot %}{% endblock foot %} From 7369d37ff43ebceb8fb020c2cc41fbca2b780afc Mon Sep 17 00:00:00 2001 From: Ivlev Denis Date: Fri, 29 Jun 2018 17:17:20 +0300 Subject: [PATCH 4/4] Fix import temlatetag --- project/templates/lilcity/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/templates/lilcity/index.html b/project/templates/lilcity/index.html index b5f4ee6f..0438f0de 100644 --- a/project/templates/lilcity/index.html +++ b/project/templates/lilcity/index.html @@ -1,5 +1,5 @@ {% load static %} -{% import setting from settings %} +{% load setting from settings %}