rename mixin

This commit is contained in:
Thomas Steen Rasmussen 2017-03-12 19:34:27 +01:00
parent 52a70b1ee2
commit a8e81dbc6f
2 changed files with 4 additions and 4 deletions

View file

@ -5,7 +5,7 @@ from . import models
from django.contrib import messages from django.contrib import messages
class CreateUserProposalMixin(SingleObjectMixin): class CreateProposalMixin(SingleObjectMixin):
def form_valid(self, form): def form_valid(self, form):
# set camp and user before saving # set camp and user before saving
form.instance.camp = self.camp form.instance.camp = self.camp

View file

@ -9,7 +9,7 @@ from django.contrib import messages
from django.shortcuts import redirect from django.shortcuts import redirect
from django.urls import reverse from django.urls import reverse
from camps.mixins import CampViewMixin from camps.mixins import CampViewMixin
from .mixins import CreateUserProposalMixin, EnsureUnpprovedProposalMixin, EnsureUserOwnsProposalMixin, EnsureWritableCampMixin from .mixins import CreateProposalMixin, EnsureUnpprovedProposalMixin, EnsureUserOwnsProposalMixin, EnsureWritableCampMixin
from . import models from . import models
import datetime, os import datetime, os
@ -33,7 +33,7 @@ class ProposalListView(LoginRequiredMixin, CampViewMixin, ListView):
return context return context
class SpeakerProposalCreateView(LoginRequiredMixin, CampViewMixin, CreateUserProposalMixin, EnsureWritableCampMixin, CreateView): class SpeakerProposalCreateView(LoginRequiredMixin, CampViewMixin, CreateProposalMixin, EnsureWritableCampMixin, CreateView):
model = models.SpeakerProposal model = models.SpeakerProposal
fields = ['name', 'biography', 'picture_small', 'picture_large'] fields = ['name', 'biography', 'picture_small', 'picture_large']
template_name = 'speakerproposal_form.html' template_name = 'speakerproposal_form.html'
@ -89,7 +89,7 @@ class SpeakerProposalPictureView(LoginRequiredMixin, CampViewMixin, EnsureUserOw
return response return response
class EventProposalCreateView(LoginRequiredMixin, CampViewMixin, CreateUserProposalMixin, EnsureWritableCampMixin, CreateView): class EventProposalCreateView(LoginRequiredMixin, CampViewMixin, CreateProposalMixin, EnsureWritableCampMixin, CreateView):
model = models.EventProposal model = models.EventProposal
fields = ['title', 'abstract', 'event_type', 'speakers'] fields = ['title', 'abstract', 'event_type', 'speakers']
template_name = 'eventproposal_form.html' template_name = 'eventproposal_form.html'