diff --git a/arches/app/media/js/bindings/datepicker.js b/arches/app/media/js/bindings/datepicker.js index 396540996e9..c68fe9c68b6 100644 --- a/arches/app/media/js/bindings/datepicker.js +++ b/arches/app/media/js/bindings/datepicker.js @@ -79,7 +79,7 @@ define([ var value = allBindingsAccessor().value; var picker = $(element).data("DateTimePicker"); if (ko.isObservable(value)) { - if (value() === "") { + if (value() === "" || event.date === false) { value(null); }else if (event.date.isValid()) { value(event.date.format(format)); diff --git a/arches/app/models/mobile_survey.py b/arches/app/models/mobile_survey.py index e5581a838f9..17949897e45 100644 --- a/arches/app/models/mobile_survey.py +++ b/arches/app/models/mobile_survey.py @@ -152,9 +152,13 @@ def serialize_for_mobile(self): serializer.geom_format = 'geojson' obj = serializer.handle_model(self) ordered_cards = self.get_ordered_cards() - expired = (datetime.strptime(str(self.enddate), '%Y-%m-%d') - datetime.now() + timedelta(hours=24)).days < 0 + expired = False + try: + expired = (datetime.strptime(str(self.enddate), '%Y-%m-%d') - datetime.now() + timedelta(hours=24)).days < 0 + except ValueError: + pass ret = JSONSerializer().serializeToPython(obj) - if expired: + if expired is True: self.active = False super(MobileSurvey, self).save() ret['active'] = False diff --git a/arches/install/arches-templates/project_name/settings.py-tpl b/arches/install/arches-templates/project_name/settings.py-tpl index d15d199e6b9..83f5da0b38c 100644 --- a/arches/install/arches-templates/project_name/settings.py-tpl +++ b/arches/install/arches-templates/project_name/settings.py-tpl @@ -115,6 +115,8 @@ LOGGING = { # Absolute filesystem path to the directory that will hold user-uploaded files. MEDIA_ROOT = os.path.join(APP_ROOT) +# Sets default max upload size to 15MB +DATA_UPLOAD_MAX_MEMORY_SIZE = 15728640 # Unique session cookie ensures that logins are treated separately for each app SESSION_COOKIE_NAME = '{{ project_name }}' diff --git a/arches/settings.py b/arches/settings.py index c3f032e9a1b..be7d9fb2d62 100644 --- a/arches/settings.py +++ b/arches/settings.py @@ -192,7 +192,10 @@ USE_L10N = True # Absolute filesystem path to the directory that will hold user-uploaded files. -MEDIA_ROOT = os.path.join(ROOT_DIR) +MEDIA_ROOT = os.path.join(ROOT_DIR) + +# Sets default max upload size to 15MB +DATA_UPLOAD_MAX_MEMORY_SIZE = 15728640 # URL that handles the media served from MEDIA_ROOT, used for managing stored files. # It must end in a slash if set to a non-empty value.