dont fail if /api/upload is called without the right arguments, render api page: fixes #2611

This commit is contained in:
j 2014-12-19 16:02:32 +00:00
parent 31c3cc908b
commit f56218e33a
2 changed files with 10 additions and 2 deletions

View file

@ -20,5 +20,5 @@ class Command(BaseCommand):
elif len(args) == 2: elif len(args) == 2:
target = args[0] target = args[0]
base = args[1] base = args[1]
print('update docs', target, 'base', base) print('update documentation in ', target, 'based on', base)
documentation.update(target, base) documentation.update(target, base)

View file

@ -5,7 +5,8 @@ import os.path
from datetime import datetime from datetime import datetime
from django import forms 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.conf import settings
from django.db.models import Count from django.db.models import Count
@ -219,6 +220,13 @@ actions.register(addMedia, cache=False)
@login_required_json @login_required_json
def firefogg_upload(request): 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'] profile = request.GET['profile']
oshash = request.GET['id'] oshash = request.GET['id']
config = settings.CONFIG['video'] config = settings.CONFIG['video']