Skip to content

Commit

Permalink
Merge pull request #4890 from archesproject/patches_from_44x_to_master
Browse files Browse the repository at this point in the history
Prevents syncing errors
  • Loading branch information
chiatt authored Jun 5, 2019
2 parents ca52495 + 38b8a94 commit 886b7f3
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion arches/app/media/js/bindings/datepicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
8 changes: 6 additions & 2 deletions arches/app/models/mobile_survey.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions arches/install/arches-templates/project_name/settings.py-tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}'
Expand Down
5 changes: 4 additions & 1 deletion arches/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 886b7f3

Please sign in to comment.