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
=== modified file 'loco_directory/teams/views.py'
--- loco_directory/teams/views.py 2013-11-24 14:27:03 +0000
+++ loco_directory/teams/views.py 2014-01-12 19:24:22 +0000
@@ -238,9 +238,11 @@
238 is_admin = launchpad.is_admin_or_owner(request.user.username, team_object)238 is_admin = launchpad.is_admin_or_owner(request.user.username, team_object)
239 is_on_lc = launchpad.is_user_on_loco_council(request.user)239 is_on_lc = launchpad.is_user_on_loco_council(request.user)
240240
241 if not is_admin or not is_on_lc:241 if not is_admin:
242 request.user.message_set.create(message=ugettext('You are not allowed to merge this team with another one.'))242 if not is_on_lc:
243 return redirect(team_object)243 request.user.message_set.create(message=ugettext('You are not allowed to merge this team with another one.'))
244 return redirect(team_object)
245
244 team_list = Team.objects.all().order_by('name')246 team_list = Team.objects.all().order_by('name')
245 other_teams = team_list.exclude(id=team_object.id)247 other_teams = team_list.exclude(id=team_object.id)
246 return render_to_response('teams/select_other_team.html',248 return render_to_response('teams/select_other_team.html',
@@ -262,9 +264,10 @@
262 launchpad.is_admin_or_owner(request.user.username, new_team)264 launchpad.is_admin_or_owner(request.user.username, new_team)
263 is_on_lc = launchpad.is_user_on_loco_council(request.user)265 is_on_lc = launchpad.is_user_on_loco_council(request.user)
264266
265 if not is_admin or not is_on_lc:267 if not is_admin:
266 request.user.message_set.create(message=ugettext('You are not allowed to merge this team with another one.'))268 if not is_on_lc:
267 return redirect(old_team)269 request.user.message_set.create(message=ugettext('You are not allowed to merge this team with another one.'))
270 return redirect(old_team)
268271
269 msgs = merge_teams(old_team, new_team)272 msgs = merge_teams(old_team, new_team)
270 for msg in msgs:273 for msg in msgs:

Subscribers

People subscribed via source and target branches