Protected logviews from exch-less users

This commit is contained in:
Sebastian Lohff 2017-01-26 23:49:19 +01:00
parent 8aa7910775
commit b3ffd41973
1 changed files with 9 additions and 0 deletions

View File

@ -37,6 +37,9 @@ def contestIndex(request):
@login_required
def log(request):
if not request.user.ref:
return HttpResponseRedirect(reverse("contest:index"))
form = None
qsos = QSO.objects.filter(owner=request.user).order_by("-ownNo")
@ -74,6 +77,9 @@ def log(request):
@login_required
def logEdit(request, qsoid):
if not request.user.ref:
return HttpResponseRedirect(reverse("contest:index"))
qso = QSO.objects.get(id=qsoid, owner=request.user)
form = None
@ -90,6 +96,9 @@ def logEdit(request, qsoid):
return render(request, 'contest/logEdit.html', {'form': form, "qso": qso})
def logDelete(request, qsoid):
if not request.user.ref:
return HttpResponseRedirect(reverse("contest:index"))
qso = QSO.objects.get(id=qsoid, owner=request.user)
if request.method == 'POST':