Self hosted FLOSS fitness/workout, nutrition and weight tracker
Override init method on image upload form
MadoctheHadoc9df85861adf0
diff --git a/wger/gallery/forms.py b/wger/gallery/forms.pyindex b0b515022..8f6b0069a 100644--- a/wger/gallery/forms.py+++ b/wger/gallery/forms.py@@ -17,6 +17,11 @@ from PIL import Image as PilImagefrom datetime import datetime, dateclass ImageForm(ModelForm):+ def __init__(self, *args, **kwargs):+ super().__init__(*args, **kwargs)+ if not self.instance.pk:+ self.initial['date'] = None+date = DateField(input_formats=DATE_FORMATS,widget=Html5DateInput(),