Commit b0a3cd23 by aagusti

perbaikan upload

2 parents ed268c24 ac4770c0
...@@ -214,11 +214,12 @@ def time_from_str(value): ...@@ -214,11 +214,12 @@ def time_from_str(value):
# return datetime.time(h, m, s) # return datetime.time(h, m, s)
return datetime.timedelta(hours=int(h), minutes=int(m), seconds=int(s)) return datetime.timedelta(hours=int(h), minutes=int(m), seconds=int(s))
def datetime_from_str(value): def datetime_from_str(value):
# separator = None # separator = None
dt = date_from_str(value) dt = date_from_str(value)
tm = time_from_str(value) tm = time_from_str(value)
return datetime.datetime(dt.year, dt.month, dt.day)+tm return datetime.datetime(dt.year, dt.month, dt.day) + tm
def dmy(tgl): def dmy(tgl):
...@@ -478,7 +479,8 @@ class Upload(SaveFile): ...@@ -478,7 +479,8 @@ class Upload(SaveFile):
return filename return filename
def save_fp(self, upload): def save_fp(self, upload):
if 'fp' not in upload or upload['fp'] == b'' or not upload['fp'] or not upload['size']: if 'fp' not in upload or upload['fp'] == b'' or not upload['fp'] or not \
upload['size']:
if "filename" in upload: if "filename" in upload:
return upload['filename'] return upload['filename']
return return
...@@ -1029,6 +1031,6 @@ def create_static_path(config, folder, url, cache_max_age=3600): ...@@ -1029,6 +1031,6 @@ def create_static_path(config, folder, url, cache_max_age=3600):
config.add_static_view(url, path=folder, cache_max_age=cache_max_age) config.add_static_view(url, path=folder, cache_max_age=cache_max_age)
def includeme(config): def includeme(config):
config.add_translation_dirs('opensipkd.tools:locale/') config.add_translation_dirs('opensipkd.tools:locale/')
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!