##// END OF EJS Templates
Moved delete view to class-based views
Moved delete view to class-based views

File last commit:

r552:39f0b88d 1.7-dev
r552:39f0b88d 1.7-dev
Show More
redirect_next_mixin.py
17 lines | 552 B | text/x-python | PythonLexer
/ boards / views / redirect_next_mixin.py
from django.shortcuts import redirect
from django.http import HttpResponseRedirect
class RedirectNextMixin:
def redirect_to_next(self, request):
"""
If a 'next' parameter was specified, redirect to the next page. This
is used when the user is required to return to some page after the
current view has finished its work.
"""
if 'next' in request.GET:
next_page = request.GET['next']
return HttpResponseRedirect(next_page)
else:
return redirect('index')