use pathlib in more places, thereby fixing some bugs

This commit is contained in:
Laura Klünder 2023-11-11 12:06:46 +01:00
parent f5c33724dc
commit 2ad9f4a099
14 changed files with 24 additions and 36 deletions

View file

@ -11,7 +11,7 @@ from django.db import migrations
def move_sources(apps, schema_editor):
Source = apps.get_model('mapdata', 'Source')
for source in Source.objects.all():
with open(os.path.join(settings.SOURCES_ROOT, source.name), 'wb') as f:
with open(settings.SOURCES_ROOT / source.name), 'wb') as f:
f.write(source.image)