chore: clarify model hack
This commit is contained in:
parent
20885a53db
commit
1626bcbdbc
|
|
@ -157,7 +157,7 @@ def migrate_avatars(apps=None, schema_editor=None):
|
||||||
User = apps.get_model("core", "User")
|
User = apps.get_model("core", "User")
|
||||||
UserImage = apps.get_model("media_files", "UserImage")
|
UserImage = apps.get_model("media_files", "UserImage")
|
||||||
|
|
||||||
# Models created by Django migration don't contain methods of the original models.
|
# Models created by Django migration don't contain methods of the parent model.
|
||||||
# We need to add them manually.
|
# We need to add them manually.
|
||||||
from wagtail.images.models import AbstractImage
|
from wagtail.images.models import AbstractImage
|
||||||
|
|
||||||
|
|
@ -166,7 +166,7 @@ def migrate_avatars(apps=None, schema_editor=None):
|
||||||
avatar_dir = settings.APPS_DIR / "static" / "avatars"
|
avatar_dir = settings.APPS_DIR / "static" / "avatars"
|
||||||
|
|
||||||
for user in User.objects.all().exclude(
|
for user in User.objects.all().exclude(
|
||||||
avatar_url="/static/avatars/myvbv-default-avatar.png"
|
avatar_url="/static/avatars/myvbv-default-avatar.png"
|
||||||
):
|
):
|
||||||
if not user.avatar_url:
|
if not user.avatar_url:
|
||||||
continue
|
continue
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue