Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Update wording of custom gym permissions

Roland Geidere2afddaa7fdc
diff --git a/wger/gym/migrations/0006_auto_20160214_1013.py b/wger/gym/migrations/0006_auto_20160214_1013.py
new file mode 100644
index 000000000..bf67a4496
--- /dev/null
+++ b/wger/gym/migrations/0006_auto_20160214_1013.py
@@ -0,0 +1,31 @@
+
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+
+
+def update_permission_names(apps, schema_editor):
+ '''
+ Updates the wording of our three custom gym permissions
+ '''
+ Permission = apps.get_model("auth", "Permission")
+
+ for name in ['Trainer, can see the users for a gym',
+ 'Admin, can manage users for a gym',
+ 'Admin, can administrate the different gyms']:
+
+ permission = Permission.objects.get(name=name)
+ permission.name = name.replace(',', ':')
+ permission.save()
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('gym', '0005_auto_20151023_1522'),
+ ]
+
+ operations = [
+ migrations.RunPython(update_permission_names),
+ ]
diff --git a/wger/gym/models.py b/wger/gym/models.py
index b71d9393a..1ab3387a5 100644
--- a/wger/gym/models.py
+++ b/wger/gym/models.py
@@ -35,9 +35,9 @@ class Gym(m.Model):
class Meta:
permissions = (
- ("gym_trainer", _("Trainer, can see the users for a gym")),
- ("manage_gym", _("Admin, can manage users for a gym")),
- ("manage_gyms", _("Admin, can administrate the different gyms")),
+ ("gym_trainer", _("Trainer: can see the users for a gym")),
+ ("manage_gym", _("Admin: can manage users for a gym")),
+ ("manage_gyms", _("Admin: can administrate the different gyms")),
)
ordering = ["name", ]