allianceauth/allianceauth/authentication/migrations/0017_remove_fleetup_permission.py
Peter Pfeufer a6b340c179
update code to reflect the new minimum python version 3.7
- update string format method
- remove redundant default arguments from function  calls
- remove unused imports
- remove unicode identifier from strings, it's default in py3 (see: https://stackoverflow.com/a/4182635/12201331)
2021-10-18 11:59:05 +02:00

21 lines
612 B
Python

from django.db import migrations
def remove_permission(apps, schema_editor):
User = apps.get_model('auth', 'User')
ContentType = apps.get_model('contenttypes', 'ContentType')
Permission = apps.get_model('auth', 'Permission')
ct = ContentType.objects.get_for_model(User)
Permission.objects.filter(codename="view_fleetup", content_type=ct, name="view_fleetup").delete()
class Migration(migrations.Migration):
dependencies = [
('authentication', '0016_ownershiprecord'),
]
operations = [
migrations.RunPython(remove_permission, migrations.RunPython.noop)
]