8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-11-23 11:53:12 +00:00

[Printer] Minor Fixes

This commit is contained in:
Maxime Bombar 2018-06-29 05:05:15 +02:00
parent 256a974c4c
commit e6c36cb507
2 changed files with 5 additions and 5 deletions

View file

@ -21,10 +21,10 @@ from .models import (
) )
class JobForm(FormRevMixin, ModelForm): class JobWithOptionsForm(FormRevMixin, ModelForm):
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
prefix = kwargs.pop('prefix', self.Meta.model.__name__) 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: class Meta:
model = JobWithOptions model = JobWithOptions

View file

@ -18,7 +18,7 @@ from users.models import User
from . import settings from . import settings
from .forms import ( from .forms import (
JobForm, JobWithOptionsForm,
) )
@ -26,8 +26,8 @@ def new_job(request):
""" """
View to create a new printing job View to create a new printing job
""" """
job_formset = formset_factory(JobForm)( job_formset = formset_factory(JobWithOptionsForm)(
request.POST or None, request.FILES, request.POST or None, request.FILES or None,
) )
if job_formset.is_valid(): if job_formset.is_valid():
for job in job_formset: for job in job_formset: