Skip to content

Commit

Permalink
Move cleanup connect to ready.
Browse files Browse the repository at this point in the history
  • Loading branch information
dracos committed Nov 19, 2023
1 parent 5b43962 commit 67f6847
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions photos/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
from sorl.thumbnail import delete


class PhotoConfig(AppConfig):
name = 'photos'


def sorl_delete(**kwargs):
delete(kwargs['file'])


cleanup_pre_delete.connect(sorl_delete)
class PhotoConfig(AppConfig):
name = 'photos'

def ready(self):
cleanup_pre_delete.connect(sorl_delete, dispatch_uid="photo_cleanup")

0 comments on commit 67f6847

Please sign in to comment.