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

from django.db import models, migrations

def set_jobmail_field(apps, schema_editor):
    OnlineUser = apps.get_model("authentication", "OnlineUser")
    for user in OnlineUser.objects.all():
        user.jobmail = True
        user.save()

class Migration(migrations.Migration):

    dependencies = [
        ('authentication', '0005_onlineuser_jobmail'),
    ]

    operations = [
        migrations.RunPython(set_jobmail_field),<commit_msg>Minor fix for correct datamigration<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models, migrations
from django.utils import timezone

def set_jobmail_field(apps, schema_editor):
    OnlineUser = apps.get_model("authentication", "OnlineUser")
    AllowedUsername = apps.get_model("authentication", "AllowedUsername")
    for user in OnlineUser.objects.all():
        if AllowedUsername.objects.filter(username=user.ntnu_username).filter(expiration_date__gte=timezone.now()).count() > 0:
            user.jobmail = True
            user.save()

class Migration(migrations.Migration):

    dependencies = [
        ('authentication', '0005_onlineuser_jobmail'),
    ]

    operations = [
        migrations.RunPython(set_jobmail_field),
{'fraction_non_alphanumeric': 0.10975609756097561, 'fraction_numerical': 0.008384146341463415, 'mean_word_length': 3.9547169811320755, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '4935961', 'n_tokens_mistral': 390, 'n_tokens_neox': 381, 'n_words': 77}