fixes #7: improve collection selector
This commit is contained in:
parent
4f77b3953d
commit
4e0228753e
2 changed files with 13 additions and 2 deletions
14
ibt2.py
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();
|
||||
});
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue