Revert "Building a voucher-verify form."

This reverts commit 9bd85aba7a.
This commit is contained in:
Marcus Scholz 2020-08-01 19:05:13 +02:00
parent d2002c9e51
commit ba3f937086
4 changed files with 3 additions and 34 deletions

View File

@ -7,11 +7,6 @@ from django import forms
from django.contrib.auth.forms import UserCreationForm, UserChangeForm from django.contrib.auth.forms import UserCreationForm, UserChangeForm
from .models import Explorer, Place, PlaceImage, Voucher from .models import Explorer, Place, PlaceImage, Voucher
class VoucherVerifyForm(forms.ModelForm):
class Meta:
model = Voucher
fields = ['code']
class ExplorerCreationForm(UserCreationForm): class ExplorerCreationForm(UserCreationForm):
class Meta: class Meta:
model = Explorer model = Explorer

View File

@ -1,15 +0,0 @@
{% extends 'global.html'%}
{% load static %}
# {% block title %}Voucher-Überprüfung{% endblock %}
{% block maincontent %}
<h2>Voucher-Überprüfung</h2>
<form method="post">
{% csrf_token %}
{{ form.as_p }}
<button type="submit">Login</button>
</form>
{% endblock maincontent %}

View File

@ -2,7 +2,6 @@ from django.urls import path, include
from django.conf.urls import url from django.conf.urls import url
from .views import ( from .views import (
hello_world, hello_world,
VoucherVerify,
place_detail_view, place_detail_view,
place_list_view, place_list_view,
SignUpView, SignUpView,
@ -13,8 +12,6 @@ from .views import (
urlpatterns = [ urlpatterns = [
path('hello_world/', hello_world), # You know what this is :P path('hello_world/', hello_world), # You know what this is :P
path('signup/', SignUpView.as_view(), name='signup'), path('signup/', SignUpView.as_view(), name='signup'),
path('voucher/<slug:code>/', VoucherVerify.as_view(), name='voucher_verify'),
path('voucher/', VoucherVerify.as_view(), name='enter_voucher'),
path('place/<int:pk>/', place_detail_view, name='place_detail'), path('place/<int:pk>/', place_detail_view, name='place_detail'),
path('place/create/', PlaceCreateView.as_view(), name='place_create'), path('place/create/', PlaceCreateView.as_view(), name='place_create'),
path('place/update/<int:pk>/', PlaceUpdateView.as_view(), name='place_edit'), path('place/update/<int:pk>/', PlaceUpdateView.as_view(), name='place_edit'),

View File

@ -5,24 +5,16 @@
from django.shortcuts import render, redirect, get_object_or_404 from django.shortcuts import render, redirect, get_object_or_404
from django.urls import reverse_lazy from django.urls import reverse_lazy
from django.views.generic.edit import CreateView, UpdateView from django.views.generic.edit import CreateView
from django.views import View from django.views import View
from django.http import Http404 from django.http import Http404
from django.views.generic.edit import UpdateView
from .forms import ExplorerCreationForm, PlaceForm, PlaceImageCreateForm, VoucherVerifyForm from .forms import ExplorerCreationForm, PlaceForm, PlaceImageCreateForm
from .models import Place, PlaceImage, Voucher from .models import Place, PlaceImage, Voucher
# Create your views here. # Create your views here.
class VoucherVerify(View):
formclass = VoucherVerifyForm
voucher_form = VoucherVerifyForm()
success_url = reverse_lazy('signin')
fields = ['code']
def get(self, request, *args, **kwargs):
return render(request, 'voucher-verify.html')
class SignUpView(CreateView): class SignUpView(CreateView):
form_class = ExplorerCreationForm form_class = ExplorerCreationForm
success_url = reverse_lazy('login') success_url = reverse_lazy('login')