From 1d711b6be6ac55ef84aa5da30b2c782dca8434f5 Mon Sep 17 00:00:00 2001 From: Maxime Bombar Date: Fri, 29 Jun 2018 05:05:15 +0200 Subject: [PATCH] [Printer] Minor Fixes --- printer/forms.py | 4 ++-- printer/views.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/printer/forms.py b/printer/forms.py index d013a91b..3d60fd38 100644 --- a/printer/forms.py +++ b/printer/forms.py @@ -21,10 +21,10 @@ from .models import ( ) -class JobForm(FormRevMixin, ModelForm): +class JobWithOptionsForm(FormRevMixin, ModelForm): def __init__(self, *args, **kwargs): prefix = kwargs.pop('prefix', self.Meta.model.__name__) - super(TrueJobForm, self).__init__(*args, prefix=prefix, **kwargs) + super(JobWithOptionsForm, self).__init__(*args, prefix=prefix, **kwargs) class Meta: model = JobWithOptions diff --git a/printer/views.py b/printer/views.py index 4dced049..21d122fc 100644 --- a/printer/views.py +++ b/printer/views.py @@ -18,7 +18,7 @@ from users.models import User from . import settings from .forms import ( - JobForm, + JobWithOptionsForm, ) @@ -26,8 +26,8 @@ def new_job(request): """ View to create a new printing job """ - job_formset = formset_factory(JobForm)( - request.POST or None, request.FILES, + job_formset = formset_factory(JobWithOptionsForm)( + request.POST or None, request.FILES or None, ) if job_formset.is_valid(): for job in job_formset: