fixes #7: improve collection selector

這個提交存在於:
Davide Alberani 2017-01-26 23:10:52 +01:00
父節點 4f77b3953d
當前提交 4e0228753e
共有 2 個檔案被更改,包括 13 行新增2 行删除

14
ibt2.py
查看文件

@ -330,7 +330,11 @@ class DaysHandler(BaseHandler):
now = datetime.datetime.now()
data['updated_by'] = self.current_user_info.get('_id')
data['updated_at'] = now
merged, doc = self.db.update('days', self.arguments, data)
day = (data.get('day') or '').strip()
if not day:
return self.build_error(status=404, message='unable to access the resource')
data['day'] = day
merged, doc = self.db.update('days', {'day': day}, data)
self.write(doc)
@ -342,7 +346,13 @@ class GroupsHandler(BaseHandler):
now = datetime.datetime.now()
data['updated_by'] = self.current_user_info.get('_id')
data['updated_at'] = now
merged, doc = self.db.update('groups', self.arguments, data)
day = (data.get('day') or '').strip()
group = (data.get('group') or '').strip()
if not (day and group):
return self.build_error(status=404, message='unable to access the resource')
data['day'] = day
data['group'] = group
merged, doc = self.db.update('groups', {'day': day, 'group': group}, data)
self.write(doc)

查看文件

@ -178,6 +178,7 @@ export default {
this.$refs.dialogObj.show({text: 'unable to edit day notes'});
}).then((json) => {
this.day.notes = json.notes;
this.reload();
});
}
},