Commit 05d83002 authored by Weblate's avatar Weblate

Merge remote-tracking branch 'origin/master'

parents e70c7221 b369c30f
...@@ -9,15 +9,22 @@ def fill_in_subscriptions(apps, schema_editor): ...@@ -9,15 +9,22 @@ def fill_in_subscriptions(apps, schema_editor):
"""Adds subscriptions to owners or ACL enabled users""" """Adds subscriptions to owners or ACL enabled users"""
Project = apps.get_model('trans', 'Project') Project = apps.get_model('trans', 'Project')
Group = apps.get_model('auth', 'Group') Group = apps.get_model('auth', 'Group')
Profile = apps.get_model('accounts', 'Profile')
for project in Project.objects.all(): for project in Project.objects.all():
for owner in project.owners.all(): for owner in project.owners.all():
owner.profile.subscriptions.add(project) try:
owner.profile.subscriptions.add(project)
except Profile.DoesNotExist:
pass
if project.enable_acl: if project.enable_acl:
group = Group.objects.get(name=project.name) group = Group.objects.get(name=project.name)
for user in group.user_set.all(): for user in group.user_set.all():
user.profile.subscriptions.add(project) try:
user.profile.subscriptions.add(project)
except Profile.DoesNotExist:
pass
class Migration(migrations.Migration): class Migration(migrations.Migration):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment