<commit_before># -*- coding: utf-8 -*-
# Generated by Django 1.11.14 on 2018-10-09 19:52
from __future__ import unicode_literals

from django.db import migrations, models
from django.db.utils import DatabaseError
import django.db.models.deletion
from cmsplugin_cascade.models import CascadeElement, CascadePage, IconFont


def forwards(apps, schema_editor):
    for cascade_element in CascadeElement.objects.all():
        if cascade_element.plugin_type not in ['FramedIconPlugin', 'TextIconPlugin', 'BootstrapButtonPlugin']:
            continue
        cms_page = cascade_element.page.get_public_object()
        try:
            icon_font = cms_page.cascadepage.icon_font
            if not icon_font:
                continue
        except (AttributeError, DatabaseError):
            continue
        if 'icon_font' not in cascade_element.glossary:
            cascade_element.glossary['icon_font'] = icon_font.pk
            cascade_element.save()


def backwards(apps, schema_editor):
    print("Backward migration not implemented")


class Migration(migrations.Migration):<commit_msg>catch all errors in migration<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.11.14 on 2018-10-09 19:52
from __future__ import unicode_literals

from django.db import migrations, models
import django.db.models.deletion
from cmsplugin_cascade.models import CascadeElement, CascadePage, IconFont


def forwards(apps, schema_editor):
    for cascade_element in CascadeElement.objects.all():
        if cascade_element.plugin_type not in ['FramedIconPlugin', 'TextIconPlugin', 'BootstrapButtonPlugin']:
            continue
        cms_page = cascade_element.page.get_public_object()
        try:
            icon_font = cms_page.cascadepage.icon_font
            if not icon_font:
                continue
        except:
            continue
        if 'icon_font' not in cascade_element.glossary:
            cascade_element.glossary['icon_font'] = icon_font.pk
            cascade_element.save()


def backwards(apps, schema_editor):
    print("Backward migration not implemented")


class Migration(migrations.Migration):
{'fraction_non_alphanumeric': 0.081296992481203, 'fraction_numerical': 0.016917293233082706, 'mean_word_length': 3.249500998003992, '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': '1883035', 'n_tokens_mistral': 649, 'n_tokens_neox': 594, 'n_words': 149}