diff options
author | Christian Pointner <equinox@helsinki.at> | 2016-09-07 15:18:00 (GMT) |
---|---|---|
committer | Christian Pointner <equinox@helsinki.at> | 2016-09-07 15:18:00 (GMT) |
commit | 4e74c1f4a476ff5e49544bcfd40ae6ee01a575ce (patch) | |
tree | 17366b64c29cc2c6ce7db684dc461fd6b0b43f74 | |
parent | 6990ff7f88f827d7193cb5ddef0be22546bccd23 (diff) |
expand maximum timerange 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 b840d03..e067e9a 100644 --- a/program/admin.py +++ b/program/admin.py @@ -46,14 +46,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) |