30 lines
932 B
Python
30 lines
932 B
Python
from django.db import migrations
|
|
|
|
def create_authorizations_view(apps, schema_editor):
|
|
AppView = apps.get_model('common', 'AppView')
|
|
AppView.objects.get_or_create(
|
|
code='authorizations',
|
|
defaults={
|
|
'name_fr': 'Autorisations',
|
|
'name_nl': 'Autorisaties',
|
|
'icon': 'bi-file-earmark-text',
|
|
'url_name': 'authorizations:authorization_list',
|
|
'is_default': False,
|
|
'order': 40,
|
|
}
|
|
)
|
|
|
|
def remove_authorizations_view(apps, schema_editor):
|
|
AppView = apps.get_model('common', 'AppView')
|
|
AppView.objects.filter(code='authorizations').delete()
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
dependencies = [
|
|
('authorizations', '0001_initial'),
|
|
('common', '0011_userwarehouselocationaccess_and_more'),
|
|
]
|
|
|
|
operations = [
|
|
migrations.RunPython(create_authorizations_view, remove_authorizations_view),
|
|
]
|