from django.http import HttpResponse
from django.utils import simplejson as json
from django.views.generic.simple import direct_to_template
from django.http import HttpResponse
from django.utils import simplejson as json
from django.views.generic.simple import direct_to_template
def ajax_login_required(view):
"""Similar ro @login_required, but instead of redirect,
just return some JSON stuff with error."""
def ajax_login_required(view):
"""Similar ro @login_required, but instead of redirect,
just return some JSON stuff with error."""
@login_required
def display_editor(request, path):
user = request.GET.get('user', request.user.username)
@login_required
def display_editor(request, path):
user = request.GET.get('user', request.user.username)
- return direct_to_template(request, 'explorer/editor.html', extra_context={
+ return render_to_response('explorer/editor.html',
+ # mimetype="text/html",
+ dictionary = {
from api.resources import library_resource
from api.forms import DocumentUploadForm
from django.http import HttpRequest, HttpResponseRedirect
from api.resources import library_resource
from api.forms import DocumentUploadForm
from django.http import HttpRequest, HttpResponseRedirect
if not request.user.has_perm('explorer.book.can_share'):
objects = objects.filter(comitter=request.user)
if not request.user.has_perm('explorer.book.can_share'):
objects = objects.filter(comitter=request.user)
return direct_to_template(request, 'manager/pull_request.html',
extra_context = {'objects': objects} )
return direct_to_template(request, 'manager/pull_request.html',
extra_context = {'objects': objects} )