old_contents: # -*- coding: utf-8 -*-
  # Generated by Django 1.11.17 on 2021-01-27 12:58
  from __future__ import unicode_literals
  
  from django.db import migrations, connection
  
  from bluebottle.clients.models import Client
  from bluebottle.clients.utils import LocalTenant
  from bluebottle.utils.utils import update_group_permissions
  
  
  def add_group_permissions(apps, schema_editor):
      tenant = Client.objects.get(schema_name=connection.tenant.schema_name)
      with LocalTenant(tenant):
          activities_perms = {
              'Staff': {
                  'perms': (
                      'add_contribution', 'change_contribution',
                      'delete_contribution',
  
                      'add_organizercontribution', 'change_organizercontribution',
                      'delete_organizercontribution',
  
                      'add_contributor', 'change_contributor',
                      'delete_contributor',
                  )
              },
          }
          time_based_perms = {
              'Staff': {
                  'perms': (
                      'add_timecontribution', 'change_timecontribution',
                      'delete_timecontribution',
                  )
              },
          }
      update_group_permissions('activities', activities_perms, apps)
      update_group_permissions('activities', time_based_perms, apps)
  
  
  class Migration(migrations.Migration):
  
      dependencies = [
          ('activities', '0037_auto_20201202_1124'),
      ]
  
      operations = [
          migrations.RunPython(
              add_group_permissions,
              migrations.RunPython.noop
          )
      ]
  
  
new_contents: # -*- coding: utf-8 -*-
  # Generated by Django 1.11.17 on 2021-01-27 12:58
  from __future__ import unicode_literals
  
  from django.db import migrations, connection
  
  from bluebottle.clients.models import Client
  from bluebottle.clients.utils import LocalTenant
  from bluebottle.utils.utils import update_group_permissions
  
  
  def add_group_permissions(apps, schema_editor):
      tenant = Client.objects.get(schema_name=connection.tenant.schema_name)
      with LocalTenant(tenant):
          activities_perms = {
              'Staff': {
                  'perms': (
                      'add_contribution', 'change_contribution',
                      'delete_contribution',
  
                      'add_organizercontribution', 'change_organizercontribution',
                      'delete_organizercontribution',
  
                      'add_contributor', 'change_contributor',
                      'delete_contributor',
                  )
              },
          }
          time_based_perms = {
              'Staff': {
                  'perms': (
                      'add_withadeadlineactivity', 'change_withadeadlineactivity',
                      'delete_withadeadlineactivity',
  
                      'add_timecontribution', 'change_timecontribution',
                      'delete_timecontribution',
                  )
              },
          }
      update_group_permissions('activities', activities_perms, apps)
      update_group_permissions('activities', time_based_perms, apps)
  
  
  class Migration(migrations.Migration):
  
      dependencies = [
          ('activities', '0037_auto_20201202_1124'),
          ('time_based', '0044_auto_20201224_1120'),
      ]
  
      operations = [
          migrations.RunPython(
              add_group_permissions,
              migrations.RunPython.noop
          )
      ]
  
  
subject: fix migration