Fix engagement period validation for non periodic services
This commit is contained in:
@@ -1321,6 +1321,7 @@ def subscription_edit_page(request: Request, subscription_id: int):
|
||||
selected_client_id=row.client_id,
|
||||
financial_year=row.financial_year,
|
||||
period_choices=period_choices_for_service(row.financial_year, getattr(row.catalogue, "recurrence_type", None)),
|
||||
period_required=recurrence_requires_period(getattr(row.catalogue, "recurrence_type", None)),
|
||||
)
|
||||
finally:
|
||||
db.close()
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
<div id="engagement-period-field">
|
||||
<label class="mb-2 block text-sm font-medium text-slate-700">Return / Engagement Period</label>
|
||||
{% if mode == 'edit' %}
|
||||
<select name="period_label" required class="w-full rounded-xl border border-slate-300 px-4 py-2 text-sm">
|
||||
<select name="period_label" {% if period_required %}required{% endif %} class="w-full rounded-xl border border-slate-300 px-4 py-2 text-sm">
|
||||
{% for value, label in period_choices %}<option value="{{ value }}" {% if subscription and subscription.period_label == value %}selected{% endif %}>{{ label }}</option>{% endfor %}
|
||||
</select>
|
||||
{% else %}
|
||||
|
||||
Reference in New Issue
Block a user