Run black over entire codebase

This commit is contained in:
2019-08-19 23:55:53 +02:00
parent fc7a9621a7
commit e3e3f6d5db
112 changed files with 8240 additions and 3214 deletions
@@ -6,20 +6,20 @@ from django.db import migrations
def copy_images(apps, schema_editor):
CaseStudy = apps.get_model('map', 'CaseStudy')
ImageFile = apps.get_model('files', 'ImageFile')
User = apps.get_model('auth', 'User')
CaseStudy = apps.get_model("map", "CaseStudy")
ImageFile = apps.get_model("files", "ImageFile")
User = apps.get_model("auth", "User")
for case_study in CaseStudy.objects.all():
author = case_study.author
if author is None:
author = User.objects.get(username='root')
author = User.objects.get(username="root")
imagefile = ImageFile(
file=case_study.image,
caption=case_study.image_caption,
credit=case_study.image_credit,
user=author
user=author,
)
imagefile.save()
case_study.images.add(imagefile)
@@ -27,10 +27,6 @@ def copy_images(apps, schema_editor):
class Migration(migrations.Migration):
dependencies = [
('map', '0065_casestudy_images'),
]
dependencies = [("map", "0065_casestudy_images")]
operations = [
migrations.RunPython(copy_images, migrations.RunPython.noop),
]
operations = [migrations.RunPython(copy_images, migrations.RunPython.noop)]