From f56218e33ab3ab96c6423b67aa06270f3fb50411 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Fri, 19 Dec 2014 16:02:32 +0000 Subject: [PATCH] dont fail if /api/upload is called without the right arguments, render api page: fixes #2611 --- .../management/commands/update_config_documentation.py | 2 +- pandora/archive/views.py | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/pandora/app/management/commands/update_config_documentation.py b/pandora/app/management/commands/update_config_documentation.py index 8bbdc1918..97281524a 100644 --- a/pandora/app/management/commands/update_config_documentation.py +++ b/pandora/app/management/commands/update_config_documentation.py @@ -20,5 +20,5 @@ class Command(BaseCommand): elif len(args) == 2: target = args[0] base = args[1] - print('update docs', target, 'base', base) + print('update documentation in ', target, 'based on', base) documentation.update(target, base) diff --git a/pandora/archive/views.py b/pandora/archive/views.py index 697dd2a84..c37fb45a0 100644 --- a/pandora/archive/views.py +++ b/pandora/archive/views.py @@ -5,7 +5,8 @@ import os.path from datetime import datetime from django import forms -from django.shortcuts import get_object_or_404, redirect +from django.shortcuts import get_object_or_404, redirect, render_to_response +from django.template import RequestContext from django.conf import settings from django.db.models import Count @@ -219,6 +220,13 @@ actions.register(addMedia, cache=False) @login_required_json def firefogg_upload(request): + if not 'profile' in request.GET or not 'id' in request.GET: + context = RequestContext(request, { + 'api': [], + 'settings': settings, + 'sitename': settings.SITENAME + }) + return render_to_response('api.html', context) profile = request.GET['profile'] oshash = request.GET['id'] config = settings.CONFIG['video']