Run black over entire codebase
This commit is contained in:
@@ -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)]
|
||||
|
||||
Reference in New Issue
Block a user