Merge lp:~daker/loco-team-portal/fix.1251958-2 into lp:loco-team-portal

Proposed by Adnane Belmadiaf
Status: Merged
Approved by: Michael Hall
Approved revision: 668
Merged at revision: 668
Proposed branch: lp:~daker/loco-team-portal/fix.1251958-2
Merge into: lp:loco-team-portal
Diff against target: 32 lines (+9/-6)
1 file modified
loco_directory/teams/views.py (+9/-6)
To merge this branch: bzr merge lp:~daker/loco-team-portal/fix.1251958-2
Reviewer Review Type Date Requested Status
Michael Hall (community) Approve
Review via email: mp+201317@code.launchpad.net

Commit message

Make sure LC has the right to merge teams

To post a comment you must log in.
Revision history for this message
Michael Hall (mhall119) wrote :

Could have just switched the 'or' to an 'and', but this looks fine too

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'loco_directory/teams/views.py'
2--- loco_directory/teams/views.py 2013-11-24 14:27:03 +0000
3+++ loco_directory/teams/views.py 2014-01-12 19:24:22 +0000
4@@ -238,9 +238,11 @@
5 is_admin = launchpad.is_admin_or_owner(request.user.username, team_object)
6 is_on_lc = launchpad.is_user_on_loco_council(request.user)
7
8- if not is_admin or not is_on_lc:
9- request.user.message_set.create(message=ugettext('You are not allowed to merge this team with another one.'))
10- return redirect(team_object)
11+ if not is_admin:
12+ if not is_on_lc:
13+ request.user.message_set.create(message=ugettext('You are not allowed to merge this team with another one.'))
14+ return redirect(team_object)
15+
16 team_list = Team.objects.all().order_by('name')
17 other_teams = team_list.exclude(id=team_object.id)
18 return render_to_response('teams/select_other_team.html',
19@@ -262,9 +264,10 @@
20 launchpad.is_admin_or_owner(request.user.username, new_team)
21 is_on_lc = launchpad.is_user_on_loco_council(request.user)
22
23- if not is_admin or not is_on_lc:
24- request.user.message_set.create(message=ugettext('You are not allowed to merge this team with another one.'))
25- return redirect(old_team)
26+ if not is_admin:
27+ if not is_on_lc:
28+ request.user.message_set.create(message=ugettext('You are not allowed to merge this team with another one.'))
29+ return redirect(old_team)
30
31 msgs = merge_teams(old_team, new_team)
32 for msg in msgs:

Subscribers

People subscribed via source and target branches