mirror of
https://bitbucket.org/jsuto/piler.git
synced 2024-11-08 00:31:58 +01:00
#1124 Fixed pilerpurge to remove the last referenced attachment
Signed-off-by: Janos SUTO <sj@acts.hu>
This commit is contained in:
parent
0d1e34007e
commit
f7cc52433c
@ -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={}):
|
||||||
|
Loading…
Reference in New Issue
Block a user