diff --git a/billard/migrations/0020_auto_20170410_1853.py b/billard/migrations/0020_auto_20170410_1853.py new file mode 100644 index 0000000..901e580 --- /dev/null +++ b/billard/migrations/0020_auto_20170410_1853.py @@ -0,0 +1,32 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10.5 on 2017-04-10 18:53 +from __future__ import unicode_literals + +from django.db import migrations + +def create_default_groups_permissions(apps, schema_editor): + # We can't import the Person model directly as it may be a newer + # version than this migration expects. We use the historical version. + Permission = apps.get_model("auth", "Permission") + Group = apps.get_model("auth", "Group") + lg = Group(name='Location') + lg.save() + lg.permissions.add(Permission.objects.get(codename="add_locationdata")) + ag = Group(name='Accounting') + ag.save() + ag.permissions.add(Permission.objects.get(codename="change_accounting")) + +def delete_default_groups_permissions(apps, schema_editor): + Group = apps.get_model("auth", "Group") + Group.objects.get(name='Location').delete() + Group.objects.get(name='Accounting').delete() + + +class Migration(migrations.Migration): + + dependencies = [ + ('billard', '0019_merge_20170310_1941'), + ] + operations = [ + migrations.RunPython(create_default_groups_permissions, delete_default_groups_permissions), + ] diff --git a/billard/tasks.py b/billard/tasks.py index 964f07f..e3194f0 100644 --- a/billard/tasks.py +++ b/billard/tasks.py @@ -53,6 +53,7 @@ def process_location_data(): hh_end=cli.location.happy_hour_end, pphh=desk.prize_hh, ) + acc.reporter_uuid = cli.uuid acc.save() ld.delete() else: diff --git a/billard/templates/billard/base.html b/billard/templates/billard/base.html index efe6f2d..07d5217 100644 --- a/billard/templates/billard/base.html +++ b/billard/templates/billard/base.html @@ -29,7 +29,9 @@