#1124 Fixed pilerpurge to remove the last referenced attachment

Signed-off-by: Janos SUTO <sj@acts.hu>
This commit is contained in:
Janos SUTO 2020-11-10 20:59:11 +01:00
parent 0d1e34007e
commit f7cc52433c

View File

@ -93,7 +93,12 @@ def purge_attachments_by_attachment_id(opts={}):
if rows == (): if rows == ():
break break
else: else:
remove_attachment_files(rows, opts) for (id, piler_id, attachment_id, refcount) in rows:
if opts['dry_run'] is False:
unlink(get_attachment_file_path(piler_id, attachment_id,
opts), opts)
else:
print(get_attachment_file_path(piler_id, attachment_id, opts))
def remove_attachment_files(rows=(), opts={}): def remove_attachment_files(rows=(), opts={}):