X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/ae34def10b226251f0d752634a7de4f1a6b8775d..6e404619938ccba6732fc9b8a3fb6c90a27bad76:/apps/sponsors/migrations/0002_move_path.py 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))