X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/e9b47e84cb98d20e851047f031292449bdbeb6fe..b77e2d24f4759d6540f20627fd4c70f7d7abcd97:/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))