Skip to content

Commit 92a715a

Browse files
Fix ScoreAnswerWidget(Textarea) browser validation issue with tinymce (#4588)
Fixes #4179 Fixes #3314
1 parent eb6f9a0 commit 92a715a

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

hypha/apply/review/blocks.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,12 @@ def get_field_kwargs(self, struct_value):
8585
return kwargs
8686

8787
def render(self, value, context=None):
88-
data = int(context["data"])
89-
choices = dict(self.get_choices(RATE_CHOICES))
90-
context["data"] = choices[data]
88+
data = context.get("data", None)
89+
if data:
90+
choices = dict(self.get_choices(RATE_CHOICES))
91+
context["data"] = choices[int(data)]
92+
else:
93+
context["data"] = ""
9194

9295
return super().render(value, context)
9396

hypha/apply/review/templates/review/review_form.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
</div>
4141
</div>
4242
{% if not has_submitted_review %}
43-
<form id="review-form-edit" class="flex-1 max-w-3xl form form--scoreable" action="" method="post">
43+
<form id="review-form-edit" class="flex-1 max-w-3xl form form--scoreable" action="" method="post" novalidate>
4444
{% csrf_token %}
4545
{% for hidden in form.hidden_fields %}
4646
{{ hidden }}

hypha/static_src/sass/components/_form.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,8 @@
364364
input[type="email"],
365365
input[type="number"],
366366
input[type="password"],
367-
input[type="datetime-local"] {
367+
input[type="datetime-local"],
368+
.tox-tinymce {
368369
border: 2px solid variables.$color--error;
369370
}
370371
}

0 commit comments

Comments
 (0)