diff options
| -rw-r--r-- | backend/views.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/backend/views.py b/backend/views.py index 244a782..fb07bb1 100644 --- a/backend/views.py +++ b/backend/views.py @@ -823,13 +823,12 @@ def api_room_video(request): def api_video_date(request): """ View top videos by date. Public API """ - form_fields = ['day', 'month', 'year'] - response = check_form_fields(request, form_fields) - if response: - return response - p = request.POST - if is_number(p['year']) and is_number(p['month']) and is_number(p['day']): - today = datetime(int(p['year']), int(p['month']), int(p['day'])) + year = request.POST.get('year', '') + month = request.POST.get('month', '') + day = request.POST.get('day', '') + + if is_number(year) and is_number(month) and is_number(day): + today = datetime(int(year), int(month), int(day)) else: today = datetime.fromtimestamp(time.mktime(date.today().timetuple())) tomorrow = today + timedelta(days=1) |
