[UPDT] PMS: Updated question template CRUD operations

This commit is contained in:
Horilla
2025-02-28 11:13:39 +05:30
parent 0a5dde29c1
commit b782ae2880
2 changed files with 10 additions and 1 deletions

View File

@@ -1183,3 +1183,12 @@ class EmployeeBonusPointForm(MF):
if employee:
self.fields["employee_id"].queryset = employee
self.initial["employee_id"] = employee.first()
def clean(self):
cleaned_data = super().clean()
bonus_point = cleaned_data.get("bonus_point")
if bonus_point <= 0:
raise forms.ValidationError(
{"bonus_point": _("Point should be greater than zero.")}
)
return cleaned_data

View File

@@ -14,4 +14,4 @@
hx-target="{% if form.instance.id %}#objectUpdateModalTarget{% else %}#objectCreateModalTarget{% endif %}">
{% csrf_token %} {{form.as_p}}
</form>
</div>
</div>