Skip to content

Commit

Permalink
collector bug
Browse files Browse the repository at this point in the history
  • Loading branch information
moogoo78 committed Jul 10, 2024
1 parent 5e44db2 commit 74db24b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions app/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,11 @@ def save_record(record, payload, collection, uid):
else:
record.project_id = None
if collector_id := payload.get('collector_id'):
if (isinstance(collector_id, int)):
record.collector_id = collector_id
try:
cid = int(collector_id)
record.collector_id = cid
except:
pass
else:
record.collector_id = None

Expand Down
2 changes: 1 addition & 1 deletion app/templates/sites/ppi/admin/record-form-view.html
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@
// combobox
['collector',].forEach( x => {
let fooInput = document.getElementById(`${x}-id-display`);
if (x in result) {
if (x in result && result.collector.hasOwnProperty('id')) {
fooInput.value = result[x].display_name;
fooInput.dataset.value = result[x].id;
}
Expand Down

0 comments on commit 74db24b

Please sign in to comment.