[UPDT] PMS: Feedback answer post function updated

This commit is contained in:
Horilla
2025-08-21 17:10:29 +05:30
parent 92b0d095bd
commit 41b93655b7
3 changed files with 20 additions and 10 deletions

View File

@@ -897,14 +897,14 @@ class QuestionForm(ModelForm):
model = Question
exclude = ["question_option_id", "template_id", "is_active"]
widgets = {
"question_type": forms.Select(
attrs={
"class": "oh-select oh-select--sm oh-select-no-search oh-select--qa-change w-100",
"required": True,
}
)
}
# widgets = {
# "question_type": forms.Select(
# attrs={
# "class": "oh-select oh-select--sm oh-select-no-search oh-select--qa-change w-100",
# "required": True,
# }
# )
# }
fields = "__all__"
def __init__(self, *args, **kwargs):

View File

@@ -30,7 +30,7 @@
<div class="col-sm-12 col-md-12 col-lg-3">
<label class="oh-label text-muted fw-bold fw-bold">{% trans "Question Type" %}
</label>
{{form.question_type}}
{% render_field form.question_type class="oh-select oh-select2 w-100 custom-select2-height" %}
{{form.question_type.errors}}
</div>
<div class="col-sm-12 col-md-12 col-lg-9" id="questionCreationFormCol">
@@ -121,5 +121,15 @@ $(document).ready(function () {
});
</script>
<style>
/* Custom style for Select2 dropdown height */
.custom-select2-height + .select2 .select2-selection--single {
height: 38px !important;
line-height: 38px !important;
padding-top: 8px;
font-size: 1.1rem;
}
</style>
{% endblock %}

View File

@@ -1943,7 +1943,7 @@ def feedback_answer_post(request, id):
for key_result in feedback.employee_key_results_id.all():
if request.POST.get(f"key_result{key_result.id}"):
answer = request.POST.get(f"key_result{key_result.id}")
KeyResultFeedback.objects.get_or_create(
keyresult, create = KeyResultFeedback.objects.get_or_create(
answer={"answer": answer},
key_result_id=key_result,
feedback_id=feedback,