Skip to content

Commit

Permalink
Fix form duplication when id > 999 and localized
Browse files Browse the repository at this point in the history
For ids higher than 999, the localization is formating the number as
1.234, or 1,234.
This format make the 'updateAllExerciseFormset' js function to fail
trying to delete the previous form:
$('#formset-base-' + exerciseId).remove()

So, each time the slider is changed, a new form is appended at the end.
  • Loading branch information
adrianlzt committed Jan 25, 2024
1 parent 409f876 commit d2faabc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions AUTHORS.rst
Expand Up @@ -75,6 +75,7 @@ Developers
* Gabriel Liss - https://github.com/gabeliss
* Alexandra Rhodes - https://github.com/arhodes130
* Jayanth Bontha - https://github.com/JayanthBontha
* Adrian Lopez - https://github.com/adrianlzt

Translators
-----------
Expand Down
2 changes: 1 addition & 1 deletion wger/manager/templates/set/formset.html
@@ -1,5 +1,5 @@
{% load wger_extras crispy_forms_tags i18n %}
<div id="formset-base-{{ base.id }}" class="mt-3">
<div id="formset-base-{{ base.id | floatformat:"0u" }}" class="mt-3">
<label class="control-label fw-bold">
{{ base.get_translation.name }}
</label>
Expand Down

0 comments on commit d2faabc

Please sign in to comment.