mirror of
https://github.com/sartography/protocol-builder-mock.git
synced 2025-01-12 00:34:44 +00:00
Add form and route to delete pre_reviews
This commit is contained in:
parent
adcc41de7e
commit
0fbbfcf898
10
pb/routes.py
10
pb/routes.py
@ -491,3 +491,13 @@ def edit_pre_review(study_id):
|
||||
pre_reviews=pre_reviews
|
||||
)
|
||||
|
||||
|
||||
@app.route('/delete_pre_review/<pre_review_id>', methods=['POST'])
|
||||
def delete_pre_review(pre_review_id):
|
||||
model = session.query(PreReview).filter(PreReview.PROT_EVENT_ID == pre_review_id).first()
|
||||
study_id = model.SS_STUDY_ID
|
||||
session.delete(model)
|
||||
session.commit()
|
||||
|
||||
redirect_url = url_for("edit_pre_review", study_id=study_id)
|
||||
return redirect(redirect_url)
|
||||
|
@ -24,6 +24,23 @@
|
||||
</form>
|
||||
{% endif %}
|
||||
|
||||
{% if 'Edit Pre Review' in title %}
|
||||
<div>
|
||||
<div>Pre Reviews</div>
|
||||
<div>
|
||||
{% for review in pre_reviews %}
|
||||
<div>
|
||||
<p>Date: {{ review.DATEENTERED }}</p>
|
||||
<p> Comments: {{ review.COMMENTS }}</p>
|
||||
<form action="{{ review.form_action }}" method="post">
|
||||
<input type=submit value=Delete label="Delete">
|
||||
</form>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<form action="{{ action }}" method="post">
|
||||
|
||||
{{ form.csrf_token() }}
|
||||
|
Loading…
x
Reference in New Issue
Block a user