SciPost Code Repository

Skip to content
Snippets Groups Projects
Commit d39acb91 authored by Jorran de Wit's avatar Jorran de Wit
Browse files

Fix bound/invalid form situation

parent 100a19ac
No related branches found
No related tags found
No related merge requests found
......@@ -66,13 +66,15 @@ class LogsFilter(forms.Form):
self.initial['end'] = today.today()
def clean(self):
data = super().clean()
# TODO: Something's bugging here if `employee` data is given. Have no clue what's going on yet.
data = self.cleaned_data
data['months'] = [dt for dt in rrule(MONTHLY, dtstart=data['start'], until=data['end'])]
return data
def get_months(self):
return self.cleaned_data['months']
if self.is_valid():
return self.cleaned_data['months']
return []
def filter(self):
"""Filter work logs and return in user-grouped format."""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment