Commit bac0c55b authored by Ryan Herbert's avatar Ryan Herbert
Browse files

patient.py small optimisation in edit_form

only get the group_id if the description has changed. The group_id is
only used by the tag registration in the route, so it makes sense to
save a query if no tags are going to be registered.
parent 248ee4a5
...@@ -240,8 +240,8 @@ def edit_form(): ...@@ -240,8 +240,8 @@ def edit_form():
id_label=request.vars["id_label"] id_label=request.vars["id_label"]
) )
group_id = get_set_group(defs.SET_TYPE_PATIENT, request.vars["id"])
if (patient.info != request.vars["info"]): if (patient.info != request.vars["info"]):
group_id = get_set_group(defs.SET_TYPE_PATIENT, request.vars["id"])
register_tags(db, defs.SET_TYPE_PATIENT, request.vars["id"], request.vars["info"], group_id, reset=True) register_tags(db, defs.SET_TYPE_PATIENT, request.vars["id"], request.vars["info"], group_id, reset=True)
res = {"redirect": "back", res = {"redirect": "back",
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment