Skip to content

Commit

Permalink
Merge pull request #4368 from magfest/add-cancellable-statuses
Browse files Browse the repository at this point in the history
Add cancellable status list for dealers
  • Loading branch information
kitsuta committed May 16, 2024
2 parents cb7c740 + 61c4eb1 commit 449a300
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions uber/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -1586,6 +1586,7 @@ def _unrepr(d):

dealer_status_label_lookup = {val: key for key, val in c.DEALER_STATUS_OPTS}
c.DEALER_EDITABLE_STATUSES = [dealer_status_label_lookup[name] for name in c.DEALER_EDITABLE_STATUS_LIST]
c.DEALER_CANCELLABLE_STATUSES = [dealer_status_label_lookup[name] for name in c.DEALER_CANCELLABLE_STATUS_LIST]


# A list of models that have properties defined for exporting for Guidebook
Expand Down
3 changes: 3 additions & 0 deletions uber/configspec.ini
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,9 @@ group_reapply_attrs = string_list(default=list('name','zip_code','address1','add
# Possible options: Imported, Pending Approval, Waitlisted, Approved, Declined, Cancelled
dealer_editable_status_list = string_list(default=list("Pending Approval", "Waitlisted"))

# As above, but this controls whether dealer groups can cancel their own applications
dealer_cancellable_status_list = string_list(default=list("Pending Approval", "Waitlisted"))

# By default, staff/volunteers are only allowed to work shifts in a maximum of
# three different departments. Historically, we've found that working in too
# many different departments can spread people too thin and cause burn out,
Expand Down
4 changes: 4 additions & 0 deletions uber/templates/preregistration/group_members.html
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,16 @@ <h2 class="h5">"{{ group.name }}" Information</h2>
{% include "groupextra.html" %}
{% if group.status in c.DEALER_EDITABLE_STATUSES %}
<button type="submit" class="btn btn-primary" value="Update Application">Update Application</button>
{% endif %}
{% if group.status in c.DEALER_CANCELLABLE_STATUSES %}
<button type="submit" class="btn btn-danger" value="Cancel {{ c.DEALER_APP_TERM|title }}" form="cancel_dealer">Cancel Application</button>
{% endif %}
</form>
{% if group.status in c.DEALER_CANCELLABLE_STATUSES %}
<form method="post" id="cancel_dealer" action="../preregistration/cancel_dealer" class="form-horizontal" role="form">
<input type="hidden" name="id" value="{{ group.id }}" />
</form>
{% endif %}
{% endif%}

{% if group.status not in [c.CANCELLED, c.DECLINED] %}
Expand Down

0 comments on commit 449a300

Please sign in to comment.