diff options
author | Ernesto Rico-Schmidt <e.rico.schmidt@gmail.com> | 2016-09-07 20:39:01 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-07 20:39:01 (GMT) |
commit | f0b1c87dfe1c63a7e17dbc6c0df8c2a8c9dab060 (patch) | |
tree | de478f2b22ccec32424110e567cfbfdb2a5fe4c8 | |
parent | 7ed2912fd7d815561aac0caaa42d0dc63dc38d4e (diff) | |
parent | 4e74c1f4a476ff5e49544bcfd40ae6ee01a575ce (diff) |
Merge pull request #4 from radio-helsinki-graz/stable
expand maximum time range for add/note to 12 weeks in the future
-rw-r--r-- | program/admin.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/program/admin.py b/program/admin.py index 444f90b..413531e 100644 --- a/program/admin.py +++ b/program/admin.py @@ -87,14 +87,14 @@ class NoteAdmin(admin.ModelAdmin): def formfield_for_foreignkey(self, db_field, request=None, **kwargs): four_weeks_ago = datetime.now() - timedelta(weeks=4) - in_eight_weeks = datetime.now() + timedelta(weeks=8) + in_twelf_weeks = datetime.now() + timedelta(weeks=12) if db_field.name == 'timeslot': try: timeslot_id = int(request.get_full_path().split('/')[-2]) except ValueError: shows = request.user.shows.all() kwargs['queryset'] = TimeSlot.objects.filter(show__in=shows, note__isnull=True, start__gt=four_weeks_ago, - start__lt=in_eight_weeks) + start__lt=in_twelf_weeks) else: kwargs['queryset'] = TimeSlot.objects.filter(note=timeslot_id) |