X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/ae34def10b226251f0d752634a7de4f1a6b8775d..d2efc0e7b845648bb915b4665beb3e2e81d4a417:/apps/sponsors/migrations/0002_move_path.py?ds=sidebyside diff --git a/apps/sponsors/migrations/0002_move_path.py b/apps/sponsors/migrations/0002_move_path.py index 1afbd540c..1f3819e6a 100644 --- a/apps/sponsors/migrations/0002_move_path.py +++ b/apps/sponsors/migrations/0002_move_path.py @@ -10,8 +10,12 @@ from os import path def move_sponsors_media(orm, old, new): - move(path.join(settings.MEDIA_ROOT, old), - path.join(settings.MEDIA_ROOT, new)) + try: + move(path.join(settings.MEDIA_ROOT, old), + path.join(settings.MEDIA_ROOT, new)) + except IOError: + # there could be no sponsors directory yet + pass for sponsor in orm.Sponsor.objects.all(): base, rest = sponsor.logo.name.split('/', 1) sponsor.logo.name = '/'.join((new, rest))