mirror of
https://github.com/sartography/protocol-builder-mock.git
synced 2025-01-12 00:34:44 +00:00
Make sure our db query returned a result.
If not, don't seed data to the form.
This commit is contained in:
parent
359f864572
commit
1b80f62136
25
pb/routes.py
25
pb/routes.py
@ -97,18 +97,19 @@ def edit_irb_info(study_id):
|
|||||||
action = BASE_HREF + "/irb_info/" + study_id
|
action = BASE_HREF + "/irb_info/" + study_id
|
||||||
title = "Edit IRB Info #" + study_id
|
title = "Edit IRB Info #" + study_id
|
||||||
if request.method == 'GET':
|
if request.method == 'GET':
|
||||||
if irb_info.IRBEVENT and irb_info.IRBEVENT.first():
|
if irb_info:
|
||||||
event = irb_info.IRBEVENT.first().EVENT
|
if irb_info.IRBEVENT and irb_info.IRBEVENT.first():
|
||||||
event_id = irb_info.IRBEVENT.first().EVENT_ID
|
event = irb_info.IRBEVENT.first().EVENT
|
||||||
event_data_string = "('" + event_id + "', '" + event + "')"
|
event_id = irb_info.IRBEVENT.first().EVENT_ID
|
||||||
form.IRBEVENT.data = event_data_string
|
event_data_string = "('" + event_id + "', '" + event + "')"
|
||||||
if irb_info.IRB_STATUS and irb_info.IRB_STATUS.first():
|
form.IRBEVENT.data = event_data_string
|
||||||
status = irb_info.IRB_STATUS.first().STATUS
|
if irb_info.IRB_STATUS and irb_info.IRB_STATUS.first():
|
||||||
status_id = irb_info.IRB_STATUS.first().STATUS_ID
|
status = irb_info.IRB_STATUS.first().STATUS
|
||||||
status_data_string = "('" + status_id + "', '" + status + "')"
|
status_id = irb_info.IRB_STATUS.first().STATUS_ID
|
||||||
form.IRB_STATUS.data = status_data_string
|
status_data_string = "('" + status_id + "', '" + status + "')"
|
||||||
if isinstance(irb_info.UVA_IRB_HSR_IS_IRB_OF_RECORD_FOR_ALL_SITES, int):
|
form.IRB_STATUS.data = status_data_string
|
||||||
form.UVA_IRB_HSR_IS_IRB_OF_RECORD_FOR_ALL_SITES.data = irb_info.UVA_IRB_HSR_IS_IRB_OF_RECORD_FOR_ALL_SITES
|
if isinstance(irb_info.UVA_IRB_HSR_IS_IRB_OF_RECORD_FOR_ALL_SITES, int):
|
||||||
|
form.UVA_IRB_HSR_IS_IRB_OF_RECORD_FOR_ALL_SITES.data = irb_info.UVA_IRB_HSR_IS_IRB_OF_RECORD_FOR_ALL_SITES
|
||||||
if request.method == 'POST':
|
if request.method == 'POST':
|
||||||
if form.validate():
|
if form.validate():
|
||||||
_update_irb_info(study_id, irb_info, form)
|
_update_irb_info(study_id, irb_info, form)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user