Compare commits

...

5 Commits

Author SHA1 Message Date
Fabio Caccamo c784a083f3 Updated version 2017-04-14 13:13:30 +02:00
Fabio Caccamo d1c912e875 Added django 1.11 support 2017-04-14 13:13:12 +02:00
Fabio Caccamo e9e950dda3 Fix error message margin left 2017-04-04 18:09:17 +02:00
Fabio Caccamo 3c4ea399e2 Updated version 2017-03-29 18:57:11 +02:00
Fabio Caccamo a28fe1c5e0 Improved Theme.get_active_theme method 2017-03-29 18:57:01 +02:00
6 changed files with 22 additions and 11 deletions
+8 -4
View File
@@ -26,8 +26,10 @@ class Theme(models.Model):
@staticmethod @staticmethod
def get_active_theme(): def get_active_theme():
objs_active_qs = Theme.objects.filter( active = True )
#get or create default theme and enforce default logo if deleted #get or create default theme and enforce default logo if deleted
default_obj_active = (Theme.objects.filter( active = True ).count() == 0) default_obj_active = (objs_active_qs.count() == 0)
default_obj, default_obj_created = Theme.objects.get_or_create(pk = '1', defaults = { 'active':default_obj_active }) default_obj, default_obj_created = Theme.objects.get_or_create(pk = '1', defaults = { 'active':default_obj_active })
if not default_obj_created and default_obj_active: if not default_obj_created and default_obj_active:
@@ -36,10 +38,12 @@ class Theme(models.Model):
if not default_obj.logo: if not default_obj.logo:
default_obj.set_default_logo() default_obj.set_default_logo()
objs_active_count = Theme.objects.filter( active = True ).count() obj = objs_active_qs.last()
objs_active_count = objs_active_qs.count()
if objs_active_count > 1:
obj.set_active()
obj = Theme.objects.filter( active = True ).last()
obj.set_active()
return obj return obj
@@ -288,7 +288,8 @@
padding-left:10px !important; padding-left:10px !important;
} }
form .aligned.wide p.help { form .aligned.wide p.help,
form .aligned.wide ul.error-list {
margin-left: 200px; margin-left: 200px;
} }
+1 -1
View File
@@ -1,4 +1,4 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
__version__ = '0.3.0' __version__ = '0.3.2'
+1
View File
@@ -29,6 +29,7 @@ setup(
'Framework :: Django :: 1.8', 'Framework :: Django :: 1.8',
'Framework :: Django :: 1.9', 'Framework :: Django :: 1.9',
'Framework :: Django :: 1.10', 'Framework :: Django :: 1.10',
'Framework :: Django :: 1.11',
'Intended Audience :: Developers', 'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License', 'License :: OSI Approved :: MIT License',
'Natural Language :: English', 'Natural Language :: English',
+5 -1
View File
@@ -32,7 +32,11 @@ TEMPLATES = [{
'BACKEND': 'django.template.backends.django.DjangoTemplates', 'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [], 'DIRS': [],
'APP_DIRS': True, 'APP_DIRS': True,
'OPTIONS': {}, 'OPTIONS': {
'context_processors': [
'django.contrib.auth.context_processors.auth',
]
},
},] },]
DATABASES = { DATABASES = {
+5 -4
View File
@@ -1,9 +1,9 @@
[tox] [tox]
envlist = envlist =
py27-{17,18,19,110}, py27-{17,18,19,110,111},
py34-{17,18,19,110}, py34-{17,18,19,110,111},
py35-{18,19,110}, py35-{18,19,110,111},
py36-{18,19,110}, py36-{18,19,110,111},
[testenv] [testenv]
passenv = CI TRAVIS TRAVIS_* passenv = CI TRAVIS TRAVIS_*
deps = deps =
@@ -11,6 +11,7 @@ deps =
18: Django >= 1.8, < 1.9 18: Django >= 1.8, < 1.9
19: Django >= 1.9, < 1.10 19: Django >= 1.9, < 1.10
110: Django >= 1.10, < 1.11 110: Django >= 1.10, < 1.11
111: Django >= 1.11, < 1.12
coverage coverage
codecov codecov
commands = commands =