Web platform for sharing free data for ML and research

By using this site, you agree to have cookies stored on your device, strictly for functional purposes, such as storing your session and preferences.

Dismiss

Fix deletion when a picture has a replacement chain

roundabout,
created on Monday, 9 September 2024, 08:37:22 (1725871042), received on Monday, 9 September 2024, 09:59:17 (1725875957)
Author identity: vlad <vlad.muntoiu@gmail.com>

35a12b6e55226f961b5060e487f6b51f04e98c60

app.py

@@ -554,6 +554,13 @@ def delete_picture(id):

                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                PictureLicence.query.filter_by(resource=resource).delete()
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                PictureRegion.query.filter_by(resource=resource).delete()
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            if resource.replaces:
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                resource.replaces.replaced_by = None
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            if resource.replaced_by:
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                resource.replaced_by.replaces = None
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            resource.copied_from = None
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            for copy in resource.copies:
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                copy.copied_from = None
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                db.session.delete(resource)
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                db.session.commit()