diff --git a/lostplaces/lostplaces_app/forms.py b/lostplaces/lostplaces_app/forms.py index d545711..6c78036 100644 --- a/lostplaces/lostplaces_app/forms.py +++ b/lostplaces/lostplaces_app/forms.py @@ -7,11 +7,6 @@ from django import forms from django.contrib.auth.forms import UserCreationForm, UserChangeForm from .models import Explorer, Place, PlaceImage, Voucher -class VoucherVerifyForm(forms.ModelForm): - class Meta: - model = Voucher - fields = ['code'] - class ExplorerCreationForm(UserCreationForm): class Meta: model = Explorer diff --git a/lostplaces/lostplaces_app/templates/voucher-verify.html b/lostplaces/lostplaces_app/templates/voucher-verify.html deleted file mode 100644 index b316ff3..0000000 --- a/lostplaces/lostplaces_app/templates/voucher-verify.html +++ /dev/null @@ -1,15 +0,0 @@ -{% extends 'global.html'%} -{% load static %} - -# {% block title %}Voucher-Überprüfung{% endblock %} - -{% block maincontent %} - -

Voucher-Überprüfung

-
- {% csrf_token %} - {{ form.as_p }} - -
- -{% endblock maincontent %} \ No newline at end of file diff --git a/lostplaces/lostplaces_app/urls.py b/lostplaces/lostplaces_app/urls.py index 913ed4e..2688eb5 100644 --- a/lostplaces/lostplaces_app/urls.py +++ b/lostplaces/lostplaces_app/urls.py @@ -2,7 +2,6 @@ from django.urls import path, include from django.conf.urls import url from .views import ( hello_world, - VoucherVerify, place_detail_view, place_list_view, SignUpView, @@ -13,8 +12,6 @@ from .views import ( urlpatterns = [ path('hello_world/', hello_world), # You know what this is :P path('signup/', SignUpView.as_view(), name='signup'), - path('voucher//', VoucherVerify.as_view(), name='voucher_verify'), - path('voucher/', VoucherVerify.as_view(), name='enter_voucher'), path('place//', place_detail_view, name='place_detail'), path('place/create/', PlaceCreateView.as_view(), name='place_create'), path('place/update//', PlaceUpdateView.as_view(), name='place_edit'), diff --git a/lostplaces/lostplaces_app/views.py b/lostplaces/lostplaces_app/views.py index 53c9239..00b03b2 100644 --- a/lostplaces/lostplaces_app/views.py +++ b/lostplaces/lostplaces_app/views.py @@ -5,24 +5,16 @@ from django.shortcuts import render, redirect, get_object_or_404 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.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 # 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): form_class = ExplorerCreationForm success_url = reverse_lazy('login')