Merge lp:~ronnie.vd.c/loco-team-portal/team-contact-lp-owner into lp:loco-team-portal

Proposed by Ronnie
Status: Merged
Approved by: Chris Johnston
Approved revision: 424
Merged at revision: 441
Proposed branch: lp:~ronnie.vd.c/loco-team-portal/team-contact-lp-owner
Merge into: lp:loco-team-portal
Diff against target: 15 lines (+3/-1)
1 file modified
loco_directory/teams/management/commands/lpupdate.py (+3/-1)
To merge this branch: bzr merge lp:~ronnie.vd.c/loco-team-portal/team-contact-lp-owner
Reviewer Review Type Date Requested Status
Chris Johnston Needs Fixing
Review via email: mp+62687@code.launchpad.net

Commit message

Adds team owner as team contact if no team contact is provided.

Description of the change

If a team has no contaxt set, put the team owner in it.

To post a comment you must log in.
Revision history for this message
Chris Johnston (cjohnston) wrote :

I would suggest to set Admins as the contacts instead of just the owner.

review: Needs Fixing

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'loco_directory/teams/management/commands/lpupdate.py'
2--- loco_directory/teams/management/commands/lpupdate.py 2011-02-19 00:55:59 +0000
3+++ loco_directory/teams/management/commands/lpupdate.py 2011-05-27 14:29:23 +0000
4@@ -79,8 +79,10 @@
5 team = filter(lambda a: a.lp_name == l.name, existing_locos)[0]
6 team.name = l.display_name
7 team.owner_profile = create_profile(get_team_owner(l).name)
8+ if not len(team.contact_profiles.all()):
9+ team.contact_profiles.add(team.owner_profile)
10 update_admins(team, l, lp)
11-
12+
13 if not existing_groups or l.name not in [g.name for g in existing_groups]:
14 group = Group(name=l.name)
15 group.save()

Subscribers

People subscribed via source and target branches