<commit_before># -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models, migrations


def migrate_avatar(apps, schema_editor):
    Avatar = apps.get_model("avatar", "Avatar")
    for avatar in Avatar.objects.filter(primary=True).all():
        avatar.user.picture = avatar.avatar
        avatar.user.save()
        avatar.save()


class Migration(migrations.Migration):
    dependencies = [
        ('users', '0006_user_picture'),
        ('avatar', '0001_initial')
    ]

    operations = [
        migrations.RunPython(migrate_avatar)

    ]<commit_msg>Fix migrations after django-avatar drop<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf import settings
from django.db import models, migrations


if 'avatar' in settings.INSTALLED_APPS:
    def migrate_avatar(apps, schema_editor):
        Avatar = apps.get_model("avatar", "Avatar")
        for avatar in Avatar.objects.filter(primary=True).all():
            avatar.user.picture = avatar.avatar
            avatar.user.save()
            avatar.save()

    class Migration(migrations.Migration):
        dependencies = [
            ('users', '0006_user_picture'),
            ('avatar', '0001_initial')
        ]

        operations = [
            migrations.RunPython(migrate_avatar)

        ]
else:
    class Migration(migrations.Migration):
        dependencies = [('users', '0006_user_picture'), ]
        operations = []
{'fraction_non_alphanumeric': 0.11920980926430517, 'fraction_numerical': 0.014986376021798364, 'mean_word_length': 2.8255208333333335, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3131965', 'n_tokens_mistral': 455, 'n_tokens_neox': 431, 'n_words': 89}