Skip to content

Commit

Permalink
fix: capacity field should render html, not output it as text
Browse files Browse the repository at this point in the history
  • Loading branch information
ArtemSBulgakov committed Jan 8, 2025
1 parent 3b0c681 commit 3ff1f9e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion adminpage/sport/admin/groupAdmin.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from django.forms import ModelForm
from django.utils import timezone
from django.utils.html import format_html
from django.utils.safestring import mark_safe

from api.crud import get_ongoing_semester
from sport.models import Group, Semester
Expand Down Expand Up @@ -40,7 +41,7 @@ def render(self, name, value, attrs=None, renderer=None):
for e in self._list:
list_html += '<button type="button" onclick="clickButton(\'%s\', \'%s\');">%s</button>' % (name, e, e)

return script + '\n' + text_html + '\n' + list_html
return mark_safe(script + '\n' + text_html + '\n' + list_html)


class TrainerTextFilter(AutocompleteFilter):
Expand Down

0 comments on commit 3ff1f9e

Please sign in to comment.