skip this for now

This commit is contained in:
Thomas Steen Rasmussen 2017-07-11 23:11:31 +02:00
parent 8fd7f4c813
commit 53199e4300

View file

@ -5,21 +5,7 @@ from __future__ import unicode_literals
from django.db import migrations from django.db import migrations
def populate_team_responsible_public_credit_names(apps, schema_editor): def populate_team_responsible_public_credit_names(apps, schema_editor):
Profile = apps.get_model("profiles", "Profile") pass
TeamMember = apps.get_model("teams", "TeamMember")
Team = apps.get_model("teams", "TeamMember")
for team in Team.objects.all():
if TeamMember.objects.filter(team=team, responsible=True).exists():
responsibles = User.objects.filter(teammember__team=team, teammember__responsible=True)
else:
responsibles = team.area.responsible.all()
for resp in responsibles:
if not resp.profile.public_credit_name:
profile = resp.profile
profile.public_credit_name = resp.profile.name
profile.save()
class Migration(migrations.Migration): class Migration(migrations.Migration):