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

Proposed by Adnane Belmadiaf
Status: Needs review
Proposed branch: lp:~daker/loco-team-portal/fix.1273491
Merge into: lp:loco-team-portal
Diff against target: 51 lines (+18/-1)
2 files modified
loco_directory/media/css/styles.css (+0/-1)
loco_directory/teams/utils.py (+18/-0)
To merge this branch: bzr merge lp:~daker/loco-team-portal/fix.1273491
Reviewer Review Type Date Requested Status
Lucy Llewellyn (community) Needs Fixing
Pablo Rubianes (community) Approve
ԜаӀtеr Ⅼарсһуnѕkі Pending
LoCo Team Portal Developers Pending
Review via email: mp+229522@code.launchpad.net

Commit message

Fixed merge functionnality

To post a comment you must log in.
683. By Adnane Belmadiaf

Fixed icons

684. By Adnane Belmadiaf

Fixes

Revision history for this message
Pablo Rubianes (pablorubianes-uy) wrote :

Approved in order to merge

review: Approve
Revision history for this message
Lucy Llewellyn (lucyllewy) wrote :

the change to loco_directory/media/css/styles.css appears unrelated. This should be backed-out leaving just the changes in loco_directory/teams/utils.py for this merge to proceed.

review: Needs Fixing

Unmerged revisions

684. By Adnane Belmadiaf

Fixes

683. By Adnane Belmadiaf

Fixed icons

682. By Adnane Belmadiaf

Fixed merge functionnality

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'loco_directory/media/css/styles.css'
2--- loco_directory/media/css/styles.css 2013-10-30 00:31:14 +0000
3+++ loco_directory/media/css/styles.css 2014-08-04 21:57:04 +0000
4@@ -1603,7 +1603,6 @@
5 width: 20px;
6 height: 20px;
7 display: inline-block;
8- top: -10px;
9 }
10
11 .pictogram-l {
12
13=== modified file 'loco_directory/teams/utils.py'
14--- loco_directory/teams/utils.py 2012-12-25 22:00:46 +0000
15+++ loco_directory/teams/utils.py 2014-08-04 21:57:04 +0000
16@@ -1,17 +1,35 @@
17 from django.utils.translation import ugettext
18
19 from events.models import TeamEvent
20+from meetings.models import TeamMeeting
21+from articles.models import Feed
22
23
24 def merge_teams(old_team, new_team):
25 msgs = []
26 related_events = TeamEvent.objects.filter(teams__id=old_team.id)
27+
28 for event in related_events:
29 for team in event.teams.filter(id=old_team.id):
30 msgs += [ugettext('New owner of event "%(event)s" is team "%(team)s".' % {'event':event.name, 'team':new_team.name})]
31 event.teams.remove(team)
32 event.teams.add(new_team)
33 event.save()
34+
35+ related_meetings = TeamMeeting.objects.filter(teams__id=old_team.id)
36+ for meeting in related_meetings:
37+ for team in meeting.teams.filter(id=old_team.id):
38+ msgs += [ugettext('New owner of meeting "%(meeting)s" is team "%(team)s".' % {'meeting':meeting.name, 'team':new_team.name})]
39+ meeting.teams.remove(team)
40+ meeting.teams.add(new_team)
41+ meeting.save()
42+
43+ related_feeds = Feed.objects.filter(team__id=old_team.id)
44+ for feed in related_feeds:
45+ msgs += [ugettext('New owner of feed "%(feed)s" is team "%(team)s".' % {'feed':feed.title, 'team':new_team.name})]
46+ feed.team = new_team
47+ feed.save()
48+
49 if old_team.contact_profiles.count() and not new_team.contact_profiles.count():
50 for contact_profile in old_team.contact_profiles.all():
51 new_team.contact_profiles.add(contact_profile)

Subscribers

People subscribed via source and target branches