<commit_before># -*- coding: utf-8 -*-
from south.v2 import DataMigration
from django_fields.fields import EncryptedCharField

class Migration(DataMigration):

    def forwards(self, orm):
        field = EncryptedCharField()

        for account in orm['email.EmailAccount'].objects.all():
            account.username = field.to_python(account.username)
            account.save()

    def backwards(self, orm):
        raise RuntimeError("It is not possible to reset the data via this migration, because of automatic encryption by the EncryptedCharField.")

    models = {
        'accounts.account': {
            'Meta': {'ordering': "['name']", 'object_name': 'Account'},
            'addresses': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['utils.Address']", 'symmetrical': 'False', 'blank': 'True'}),
            'bankaccountnumber': ('django.db.models.fields.CharField', [], {'max_length': '20', 'blank': 'True'}),
            'bic': ('django.db.models.fields.CharField', [], {'max_length': '20', 'blank': 'True'}),<commit_msg>Password also needs to be converted<commit_after># -*- coding: utf-8 -*-
from south.v2 import DataMigration
from django_fields.fields import EncryptedCharField

class Migration(DataMigration):

    def forwards(self, orm):
        field = EncryptedCharField()

        for account in orm['email.EmailAccount'].objects.all():
            account.username = field.to_python(account.username)
            account.password = <PASSWORD>(account.password)
            account.save()

    def backwards(self, orm):
        raise RuntimeError("It is not possible to reset the data via this migration, because of automatic encryption by the EncryptedCharField.")

    models = {
        'accounts.account': {
            'Meta': {'ordering': "['name']", 'object_name': 'Account'},
            'addresses': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['utils.Address']", 'symmetrical': 'False', 'blank': 'True'}),
            'bankaccountnumber': ('django.db.models.fields.CharField', [], {'max_length': '20', 'blank': 'True'}),
            'bic': ('django.db.models.fields.CharField', [], {'max_length': '20', 'blank': 'True'}),
{'fraction_non_alphanumeric': 0.16666666666666666, 'fraction_numerical': 0.005449591280653951, 'mean_word_length': 3.486761710794297, 'pattern_counts': {'":': 0, '<': 4, '<?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': '3318669', 'n_tokens_mistral': 628, 'n_tokens_neox': 611, 'n_words': 154}