Self hosted FLOSS fitness/workout, nutrition and weight tracker
Explicitly set the fields to use in the formset
Roland Geider07b615f9d3ab
diff --git a/wger/manager/views/set.py b/wger/manager/views/set.pyindex 885df28c5..054d85227 100644--- a/wger/manager/views/set.py+++ b/wger/manager/views/set.py@@ -43,11 +43,11 @@ logger = logging.getLogger(__name__)# ************************# Set functions# ************************-SETTING_FORMSET_EXCLUDE = ('comment', 'exercise', 'set', 'order')+SETTING_FORMSET_FIELDS = ('reps', 'weight')SettingFormset = modelformset_factory(Setting,form=SettingForm,- exclude=SETTING_FORMSET_EXCLUDE,+ fields=SETTING_FORMSET_FIELDS,can_delete=True,can_order=False,extra=1)@@ -135,7 +135,7 @@ def get_formset(request, exercise_pk, reps=Set.DEFAULT_SETS):Setting,can_delete=False,extra=int(reps),- exclude=SETTING_FORMSET_EXCLUDE)+ fields=SETTING_FORMSET_FIELDS)formset = SettingFormSet(queryset=Setting.objects.none(),prefix='exercise{0}'.format(exercise_pk))