You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
1.1 KiB

7 years ago
from django.shortcuts import render
7 years ago
from django.contrib.auth.decorators import login_required
from django.http import HttpResponseRedirect
from django.urls import reverse
from .forms import MntForm, ContactForm
@login_required
def dbDashboard(request):
mnts = request.user.maintainer_set.all()
mntForm = contactForm = None
if request.method == "POST":
mntForm = MntForm(data=request.POST, prefix="mnt_")
contactForm = ContactForm(person=True, data=request.POST, prefix="contact")
if mntForm.is_valid() and contactForm.is_valid():
print("NOOT")
#return HttpResponseRedirect(reverse("whoisdb:dashboard"))
mntForm = MntForm(prefix="mnt", initial={'handle': 'AUTO', 'description': 'Main maintainer of %s' % request.user.username})
contactForm = ContactForm(person=True, initial={'handle': 'AUTO'}, prefix='contact_')
return render(request, "whoisdb/overview.html", {"mnts": mnts, "mntForm": mntForm, "contactForm": contactForm})
def manageMnt(request, mnt=None):
if mnt:
# object or 404
pass
return render(request, "whoisdb/overview.html", {})
7 years ago