Skip to content

Commit

Permalink
task/WP-695: Add status change to edit registration modal (#312)
Browse files Browse the repository at this point in the history
* Add new <select> for edit registration modal for updating registration status

* Add status update to update_registration db util function

* Prevent new registration status field appearing on registration renewal form

---------

Co-authored-by: Chandra Y <[email protected]>
  • Loading branch information
edmondsgarrett and chandra-tacc authored Sep 18, 2024
1 parent 6dd9977 commit 973b4c2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,20 @@
{% if r %}
<input type="hidden" name="edit-registration-form" value>
<input type="hidden" name="reg_id" value="{{r.reg_id}}">

{% if not renew %}
<label for="reg_status"> Registration Status </label>
<div class="field-wrapper select">
<select name="reg_status" class="choicefield" id="reg_status">
{% for option in status_options %}
{% if not forloop.first %}
<option class="dropdown-text" {% if option == r.reg_status %}selected{% endif %}>{{ option }}</option>
{% endif %}
{% endfor %}
</select>
</div>
{% endif %}

{% endif %}

<div class="form-errors" style="display: none"></div>
Expand Down
2 changes: 2 additions & 0 deletions apcd_cms/src/apps/utils/apcd_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ def update_registration(form, reg_id):
operation = """UPDATE registrations
SET
submitting_for_self = %s,
registration_status = %s,
org_type = %s,
business_name = %s,
mail_address = %s,
Expand All @@ -267,6 +268,7 @@ def update_registration(form, reg_id):
RETURNING registration_id"""
values = (
True if form['on-behalf-of'] == 'true' else False,
form['reg_status'],
form['type'],
_clean_value(form['business-name']),
_clean_value(form['mailing-address']),
Expand Down

0 comments on commit 973b4c2

Please sign in to comment.