Ticket #5427: 0001-Fix-issue-5427-fail-to-delete-reported-media.patch

File 0001-Fix-issue-5427-fail-to-delete-reported-media.patch, 1.1 KB (added by ayleph, 8 years ago)
  • mediagoblin/db/base.py

    From d6793a1ce8b61067e1700dcd5533efb6bb4c3f6e Mon Sep 17 00:00:00 2001
    From: Andrew Browning <ayleph@thisshitistemp.com>
    Date: Fri, 26 Feb 2016 00:45:29 -0500
    Subject: [PATCH] Fix issue 5427 fail to delete reported media
    
    This patch undoes a portion of code introduced in 8de5a93 which
    attempts to set an illegal object_id to reports for media which are
    subsequently deleted.
    ---
     mediagoblin/db/base.py | 8 --------
     1 file changed, 8 deletions(-)
    
    diff --git a/mediagoblin/db/base.py b/mediagoblin/db/base.py
    index 0f17a3a..849acd8 100644
    a b class GMGTableBase(object):  
    122122                    object_id=gmr.id
    123123                )
    124124                notifications.delete()
    125                
    126                 # Set None on reports found
    127                 reports = Report.query.filter_by(
    128                     object_id=gmr.id
    129                 )
    130                 for report in reports:
    131                     report.object_id = None
    132                     report.save(commit=commit)
    133125
    134126        # Hand off to the correct deletion function.
    135127        if deletion == self.HARD_DELETE: