<commit_before># -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models

class Migration(DataMigration):

    def forwards(self, orm):
        try:
            perm = orm['auth.permission'].objects.get(codename='add_activitylog')
            group = orm['auth.group'].objects.get(name='panda_user')

            group.permissions.add(perm)
        except:
            pass

    def backwards(self, orm):
        perm = orm['auth.permission'].objects.get(codename='add_activitylog')
        group = orm['auth.group'].objects.get(name='panda_user')

        group.permissions.remove(perm)

    models = {
        'auth.group': {
            'Meta': {'object_name': 'Group'},
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),<commit_msg>Document why migration is weird.<commit_after># -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models

class Migration(DataMigration):

    def forwards(self, orm):
        """
        This migration will fail if run against a clean database (fresh setup)
        This is fine because the permission will be installed from the fixture.
        """
        try:
            perm = orm['auth.permission'].objects.get(codename='add_activitylog')
            group = orm['auth.group'].objects.get(name='panda_user')

            group.permissions.add(perm)
        except:
            pass

    def backwards(self, orm):
        perm = orm['auth.permission'].objects.get(codename='add_activitylog')
        group = orm['auth.group'].objects.get(name='panda_user')

        group.permissions.remove(perm)

    models = {
        'auth.group': {
            'Meta': {'object_name': 'Group'},
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
{'fraction_non_alphanumeric': 0.14225053078556263, 'fraction_numerical': 0.0021231422505307855, 'mean_word_length': 2.6888454011741683, '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': '525404', 'n_tokens_mistral': 549, 'n_tokens_neox': 537, 'n_words': 121}