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