def fill_in_subscriptions(apps, schema_editor):
 Project = apps.get_model(u'trans', u'Project')
 Group = apps.get_model(u'auth', u'Group')
 Profile = apps.get_model(u'accounts', u'Profile')
 for project in Project.objects.all():
  for owner in project.owners.all():
   try:
    owner.profile.subscriptions.add(project)
   except Profile.DoesNotExist:
    pass
  if project.enable_acl:
   try:
    group = Group.objects.get(name=project.name)
    for user in group.user_set.all():
     try:
      user.profile.subscriptions.add(project)
     except Profile.DoesNotExist:
      pass
   except Group.DoesNotExist:
    pass

def fill_in_subscriptions ( apps , schema_editor ) : Project = apps . get_model ( u'trans' , u'Project' ) Group = apps . get_model ( u'auth' , u'Group' ) Profile = apps . get_model ( u'accounts' , u'Profile' ) for project in Project . objects . all ( ) : for owner in project . owners . all ( ) : try : owner . profile . subscriptions . add ( project ) except Profile . DoesNotExist : pass if project . enable_acl : try : group = Group . objects . get ( name = project . name ) for user in group . user_set . all ( ) : try : user . profile . subscriptions . add ( project ) except Profile . DoesNotExist : pass except Group . DoesNotExist : pass
adds subscriptions to owners or acl enabled users .