Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c784a083f3 | |||
| d1c912e875 | |||
| e9e950dda3 | |||
| 3c4ea399e2 | |||
| a28fe1c5e0 |
@@ -26,8 +26,10 @@ class Theme(models.Model):
|
||||
@staticmethod
|
||||
def get_active_theme():
|
||||
|
||||
objs_active_qs = Theme.objects.filter( active = True )
|
||||
|
||||
#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 })
|
||||
|
||||
if not default_obj_created and default_obj_active:
|
||||
@@ -36,10 +38,12 @@ class Theme(models.Model):
|
||||
if not default_obj.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
|
||||
|
||||
|
||||
|
||||
@@ -288,7 +288,8 @@
|
||||
padding-left:10px !important;
|
||||
}
|
||||
|
||||
form .aligned.wide p.help {
|
||||
form .aligned.wide p.help,
|
||||
form .aligned.wide ul.error-list {
|
||||
margin-left: 200px;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
__version__ = '0.3.0'
|
||||
__version__ = '0.3.2'
|
||||
|
||||
|
||||
@@ -29,6 +29,7 @@ setup(
|
||||
'Framework :: Django :: 1.8',
|
||||
'Framework :: Django :: 1.9',
|
||||
'Framework :: Django :: 1.10',
|
||||
'Framework :: Django :: 1.11',
|
||||
'Intended Audience :: Developers',
|
||||
'License :: OSI Approved :: MIT License',
|
||||
'Natural Language :: English',
|
||||
|
||||
+5
-1
@@ -32,7 +32,11 @@ TEMPLATES = [{
|
||||
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
||||
'DIRS': [],
|
||||
'APP_DIRS': True,
|
||||
'OPTIONS': {},
|
||||
'OPTIONS': {
|
||||
'context_processors': [
|
||||
'django.contrib.auth.context_processors.auth',
|
||||
]
|
||||
},
|
||||
},]
|
||||
|
||||
DATABASES = {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
[tox]
|
||||
envlist =
|
||||
py27-{17,18,19,110},
|
||||
py34-{17,18,19,110},
|
||||
py35-{18,19,110},
|
||||
py36-{18,19,110},
|
||||
py27-{17,18,19,110,111},
|
||||
py34-{17,18,19,110,111},
|
||||
py35-{18,19,110,111},
|
||||
py36-{18,19,110,111},
|
||||
[testenv]
|
||||
passenv = CI TRAVIS TRAVIS_*
|
||||
deps =
|
||||
@@ -11,6 +11,7 @@ deps =
|
||||
18: Django >= 1.8, < 1.9
|
||||
19: Django >= 1.9, < 1.10
|
||||
110: Django >= 1.10, < 1.11
|
||||
111: Django >= 1.11, < 1.12
|
||||
coverage
|
||||
codecov
|
||||
commands =
|
||||
|
||||
Reference in New Issue
Block a user