From a8e81dbc6f5aa1866e29ee64e4c88058e590e383 Mon Sep 17 00:00:00 2001 From: Thomas Steen Rasmussen Date: Sun, 12 Mar 2017 19:34:27 +0100 Subject: [PATCH] rename mixin --- src/program/mixins.py | 2 +- src/program/views.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/program/mixins.py b/src/program/mixins.py index 87fb9cda..6bf9e8c1 100644 --- a/src/program/mixins.py +++ b/src/program/mixins.py @@ -5,7 +5,7 @@ from . import models from django.contrib import messages -class CreateUserProposalMixin(SingleObjectMixin): +class CreateProposalMixin(SingleObjectMixin): def form_valid(self, form): # set camp and user before saving form.instance.camp = self.camp diff --git a/src/program/views.py b/src/program/views.py index cd63aad7..a1554ac0 100644 --- a/src/program/views.py +++ b/src/program/views.py @@ -9,7 +9,7 @@ from django.contrib import messages from django.shortcuts import redirect from django.urls import reverse from camps.mixins import CampViewMixin -from .mixins import CreateUserProposalMixin, EnsureUnpprovedProposalMixin, EnsureUserOwnsProposalMixin, EnsureWritableCampMixin +from .mixins import CreateProposalMixin, EnsureUnpprovedProposalMixin, EnsureUserOwnsProposalMixin, EnsureWritableCampMixin from . import models import datetime, os @@ -33,7 +33,7 @@ class ProposalListView(LoginRequiredMixin, CampViewMixin, ListView): return context -class SpeakerProposalCreateView(LoginRequiredMixin, CampViewMixin, CreateUserProposalMixin, EnsureWritableCampMixin, CreateView): +class SpeakerProposalCreateView(LoginRequiredMixin, CampViewMixin, CreateProposalMixin, EnsureWritableCampMixin, CreateView): model = models.SpeakerProposal fields = ['name', 'biography', 'picture_small', 'picture_large'] template_name = 'speakerproposal_form.html' @@ -89,7 +89,7 @@ class SpeakerProposalPictureView(LoginRequiredMixin, CampViewMixin, EnsureUserOw return response -class EventProposalCreateView(LoginRequiredMixin, CampViewMixin, CreateUserProposalMixin, EnsureWritableCampMixin, CreateView): +class EventProposalCreateView(LoginRequiredMixin, CampViewMixin, CreateProposalMixin, EnsureWritableCampMixin, CreateView): model = models.EventProposal fields = ['title', 'abstract', 'event_type', 'speakers'] template_name = 'eventproposal_form.html'