Updates ui and redirects for invites
This commit is contained in:
@ -6,6 +6,7 @@ from django.db.models import Avg, Count, Q
|
||||
from django.http import HttpResponseBadRequest, HttpResponseNotFound,\
|
||||
JsonResponse
|
||||
from django.core.exceptions import PermissionDenied
|
||||
from django.shortcuts import redirect
|
||||
from django.template.response import TemplateResponse
|
||||
from django.views.decorators.csrf import csrf_exempt
|
||||
|
||||
@ -184,6 +185,8 @@ def import_status(request, job_id):
|
||||
|
||||
def login_page(request):
|
||||
''' authentication '''
|
||||
if request.user.is_authenticated:
|
||||
return redirect('/')
|
||||
# send user to the login page
|
||||
data = {
|
||||
'site_settings': models.SiteSettings.get(),
|
||||
@ -203,6 +206,8 @@ def about_page(request):
|
||||
|
||||
def invite_page(request, code):
|
||||
''' endpoint for sending invites '''
|
||||
if request.user.is_authenticated:
|
||||
return redirect('/')
|
||||
try:
|
||||
invite = models.SiteInvite.objects.get(code=code)
|
||||
if not invite.valid():
|
||||
|
Reference in New Issue
Block a user