mirror of https://github.com/snachodog/mybuddy.git
Move ALLOW_UPLOADS to BABY_BUDDY dict
This commit is contained in:
parent
0c57e21c02
commit
969958df09
|
@ -139,8 +139,6 @@ MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
|
|||
|
||||
WHITENOISE_ROOT = os.path.join(BASE_DIR, 'static', 'root')
|
||||
|
||||
ALLOW_UPLOADS = os.environ.get('ALLOW_UPLOADS', True)
|
||||
|
||||
|
||||
# Django Rest Framework
|
||||
# http://www.django-rest-framework.org/#
|
||||
|
@ -165,5 +163,6 @@ REST_FRAMEWORK = {
|
|||
|
||||
BABY_BUDDY = {
|
||||
'NAP_START_MIN': os.environ.get('NAP_START_MIN', '06:00'),
|
||||
'NAP_START_MAX': os.environ.get('NAP_START_MAX', '18:00')
|
||||
'NAP_START_MAX': os.environ.get('NAP_START_MAX', '18:00'),
|
||||
'ALLOW_UPLOADS': os.environ.get('ALLOW_UPLOADS', True)
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
from .base import *
|
||||
|
||||
|
||||
ALLOW_UPLOADS = os.environ.get('ALLOW_UPLOADS', False)
|
||||
BABY_BUDDY['ALLOW_UPLOADS'] = os.environ.get('ALLOW_UPLOADS', False)
|
||||
|
||||
|
||||
# Database
|
||||
|
|
|
@ -3,7 +3,7 @@ import dj_database_url
|
|||
from .base import *
|
||||
|
||||
|
||||
ALLOW_UPLOADS = os.environ.get('ALLOW_UPLOADS', False)
|
||||
BABY_BUDDY['ALLOW_UPLOADS'] = os.environ.get('ALLOW_UPLOADS', False)
|
||||
|
||||
|
||||
# Database
|
||||
|
|
|
@ -13,7 +13,7 @@ class ChildAdmin(admin.ModelAdmin):
|
|||
list_filter = ('last_name',)
|
||||
search_fields = ('first_name', 'last_name', 'birth_date')
|
||||
fields = ['first_name', 'last_name', 'birth_date']
|
||||
if settings.ALLOW_UPLOADS:
|
||||
if settings.BABY_BUDDY['ALLOW_UPLOADS']:
|
||||
fields.append('picture')
|
||||
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ class ChildForm(forms.ModelForm):
|
|||
'last_name',
|
||||
'birth_date'
|
||||
]
|
||||
if settings.ALLOW_UPLOADS:
|
||||
if settings.BABY_BUDDY['ALLOW_UPLOADS']:
|
||||
fields.append('picture')
|
||||
widgets = {
|
||||
'birth_date': forms.DateInput(attrs={
|
||||
|
|
Loading…
Reference in New Issue