pdf: hide fields mapping on create and edit views (#75078)
gitea/passerelle/pipeline/head This commit looks good
Details
gitea/passerelle/pipeline/head This commit looks good
Details
This commit is contained in:
parent
24a0491d7a
commit
e34f385be2
|
@ -115,6 +115,11 @@ class Resource(BaseResource):
|
|||
class Meta:
|
||||
verbose_name = _('PDF')
|
||||
|
||||
@classmethod
|
||||
def get_manager_form_class(cls, **kwargs):
|
||||
kwargs['exclude'] = tuple(kwargs.get('exclude') or ()) + ('fields_mapping',)
|
||||
return super().get_manager_form_class(**kwargs)
|
||||
|
||||
def run_pdftk(self, args):
|
||||
args = [settings.PDFTK_PATH] + args + ['output', '-']
|
||||
try:
|
||||
|
|
|
@ -213,3 +213,13 @@ def test_fill_form_ok(app, admin_user, pdf, cerfa_content):
|
|||
pdf_ = PDF(resp.content)
|
||||
page = pdf_.page(0)
|
||||
assert not page.fields
|
||||
|
||||
|
||||
def test_add_or_edit(app, admin_user, pdf, cerfa_content):
|
||||
app = login(app)
|
||||
resp = app.get('/manage/pdf/add')
|
||||
assert b'fields_mapping' not in resp.content
|
||||
|
||||
pdf.fill_form_file.save('form.pdf', ContentFile(cerfa_content))
|
||||
resp = app.get('/manage/pdf/test/edit')
|
||||
assert b'fields_mapping' not in resp.content
|
||||
|
|
Loading…
Reference in New Issue