Skip to content

Commit d133693

Browse files
committed
add handling for Tier3 quantity divisibility
1 parent c96606c commit d133693

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

coldfront/core/allocation/templates/allocation/allocation_detail.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,11 @@ <h3><i class="fas fa-list" aria-hidden="true"></i> Allocation Information</h3>
115115
<th scope="row" class="text-nowrap">Service Period:</th>
116116
<td>1 Month</td>
117117
</tr>
118-
{% if offer_letter_code %}
118+
{% if expense_code %}
119119
<tr>
120120
<th scope="row" class="text-nowrap">Requested Expense Code:</th>
121121
<td>
122-
{% for code in offer_letter_code %}
122+
{% for code in expense_code %}
123123
{{ code.value }}<br>
124124
{% endfor %}
125125
</td>

coldfront/core/allocation/views.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -608,6 +608,10 @@ def form_valid(self, form):
608608
quantity = form_data.get('quantity', 1)
609609
allocation_account = form_data.get('allocation_account', None)
610610

611+
if resource_obj.name == "Tier 3" and quantity % 20 != 0:
612+
form.add_error("quantity", format_html("Tier 3 quantity must be a multiple of 20."))
613+
return self.form_invalid(form)
614+
611615
# A resource is selected that requires an account name selection but user has no account names
612616
if (
613617
ALLOCATION_ACCOUNT_ENABLED

0 commit comments

Comments
 (0)