Merge branch 'master' of github.com:bornhack/bornhack-website

This commit is contained in:
Stephan Telling 2017-07-11 23:15:31 +02:00
commit 3ef4094e94
3 changed files with 3 additions and 16 deletions

View file

@ -5,21 +5,7 @@ from __future__ import unicode_literals
from django.db import migrations
def populate_team_responsible_public_credit_names(apps, schema_editor):
Profile = apps.get_model("profiles", "Profile")
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()
pass
class Migration(migrations.Migration):

View file

@ -18,3 +18,4 @@ class Migration(migrations.Migration):
new_name='abstract',
),
]

View file

@ -8,7 +8,7 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('program', '0007_populate_public_credit_names_for_team_responsibles'),
('program', '0007_auto_20160807_1333'),
]
operations = [