Merge branch 'testing' into without-teal

This commit is contained in:
Cayo Puigdefabregas 2023-04-20 09:18:17 +02:00
commit e224f22b85
1 changed files with 6 additions and 2 deletions

View File

@ -1293,7 +1293,9 @@ class TradeDocumentForm(FlaskForm):
).one()
kwargs['obj'] = self._obj
if self._obj:
if not self.file_name.args:
self.file_name.args = ("File", [validators.DataRequired()])
if doc_id:
self.file_name.args = ()
super().__init__(*args, **kwargs)
@ -1399,7 +1401,9 @@ class DeviceDocumentForm(FlaskForm):
).one()
kwargs['obj'] = self._obj
if self._obj:
if not self.file_name.args:
self.file_name.args = ("File", [validators.DataRequired()])
if doc_id:
self.file_name.args = ()
super().__init__(*args, **kwargs)