formdata : honor with_history parameter (#89918)
gitea/wcs/pipeline/head This commit looks good
Details
gitea/wcs/pipeline/head This commit looks good
Details
This commit is contained in:
parent
daab9515c0
commit
8a7b5977ba
|
@ -458,7 +458,7 @@ class CardFileByTokenDirectory(Directory):
|
|||
context = token.data
|
||||
carddef = CardDef.get_by_urlname(context['carddef_slug'])
|
||||
data = carddef.data_class().get(context['data_id'])
|
||||
for field_data in data.get_all_file_data():
|
||||
for field_data in data.get_all_file_data(with_history=True):
|
||||
if not hasattr(field_data, 'file_digest'):
|
||||
continue
|
||||
if field_data.file_digest() == context['file_digest']:
|
||||
|
|
|
@ -429,7 +429,7 @@ class FormData(StorableObject):
|
|||
elif isinstance(part, WorkflowFormEvolutionPart):
|
||||
for field_data in (part.data or {}).values():
|
||||
yield from check_field_data(field_data)
|
||||
elif isinstance(part, ContentSnapshotPart):
|
||||
elif isinstance(part, ContentSnapshotPart) and with_history:
|
||||
# look into old and new values (belt and suspenders)
|
||||
for field_data in list((part.old_data or {}).values()) + list((part.new_data or {}).values()):
|
||||
yield from check_field_data(field_data)
|
||||
|
|
|
@ -789,7 +789,7 @@ class FormStatusPage(Directory, FormTemplateMixin):
|
|||
if get_request().form and get_request().form.get('hash'):
|
||||
# look in all known formdata files for file with given hash
|
||||
file_digest = get_request().form.get('hash')
|
||||
for field_data in self.filled.get_all_file_data():
|
||||
for field_data in self.filled.get_all_file_data(with_history=True):
|
||||
if not hasattr(field_data, 'file_digest'):
|
||||
continue
|
||||
if field_data.file_digest() == file_digest:
|
||||
|
|
Loading…
Reference in New Issue