Merge lp:~cjohnston/loco-team-portal/699692 into lp:loco-team-portal

Proposed by Chris Johnston
Status: Merged
Merged at revision: 361
Proposed branch: lp:~cjohnston/loco-team-portal/699692
Merge into: lp:loco-team-portal
Diff against target: 12 lines (+2/-1)
1 file modified
loco_directory/events/views.py (+2/-1)
To merge this branch: bzr merge lp:~cjohnston/loco-team-portal/699692
Reviewer Review Type Date Requested Status
Adnane Belmadiaf Needs Fixing
Review via email: mp+45477@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Adnane Belmadiaf (daker) wrote :

the problem with your fix is that when you will try to copy an event you will create two events, one is attached to a team and the other one not.
As you can see here http://i.imgur.com/WYJzF.png the first "Test event 1" is the original event, the second "Test event 1" is created because of the "team_event.save()" but not attached to a team , "Test event 2" is created after i submit the form.
I made a fix here http://pastebin.com/ZWRMB9gA for both bug #699692 & bug #681984 .

review: Needs Fixing
Revision history for this message
Adnane Belmadiaf (daker) wrote :

Well the fix i posted will run into problems if someone posted a copied event before you do it, the actual fix will get the last event's id and increment it http://pastebin.com/MkWBj8DR .

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'loco_directory/events/views.py'
2--- loco_directory/events/views.py 2011-01-05 16:01:17 +0000
3+++ loco_directory/events/views.py 2011-01-07 02:47:53 +0000
4@@ -230,7 +230,8 @@
5 team_event = get_object_or_404(TeamEvent, pk=team_event_id)
6 team_object = team_event.teams.all()[0]
7 team_event.id = team_event.pk = None
8-
9+ team_event.save()
10+
11 is_on_lc = launchpad.is_user_on_loco_council(request.user)
12 is_member = launchpad.is_team_member(request.user, team_object)
13

Subscribers

People subscribed via source and target branches