Merge lp:~aelkner/schooltool/first_last_crash into lp:schooltool/1.7

Proposed by Alan Elkner
Status: Merged
Merged at revision: 2785
Proposed branch: lp:~aelkner/schooltool/first_last_crash
Merge into: lp:schooltool/1.7
Diff against target: 53 lines (+21/-2)
3 files modified
src/schooltool/schoolyear/browser/ftests/first_last_crash.txt (+7/-0)
src/schooltool/schoolyear/browser/schoolyear.py (+12/-0)
src/schooltool/schoolyear/browser/templates/schoolyear_container.pt (+2/-2)
To merge this branch: bzr merge lp:~aelkner/schooltool/first_last_crash
Reviewer Review Type Date Requested Status
SchoolTool Owners Pending
Review via email: mp+58229@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/schooltool/schoolyear/browser/ftests/first_last_crash.txt'
2--- src/schooltool/schoolyear/browser/ftests/first_last_crash.txt 2011-03-31 23:50:26 +0000
3+++ src/schooltool/schoolyear/browser/ftests/first_last_crash.txt 2011-04-19 05:20:55 +0000
4@@ -46,3 +46,10 @@
5 <input type="checkbox" name="delete.first" id="delete.first" />
6 <input type="checkbox" name="delete.last" id="delete.last" />
7
8+The School Years view also needs to not crash.
9+
10+ >>> manager.getLink('Manage').click()
11+ >>> manager.getLink('School Years').click()
12+ >>> manager.printQuery("id('content-body')/p[1]/text()")
13+ The active school year is (... - ...)
14+
15
16=== modified file 'src/schooltool/schoolyear/browser/schoolyear.py'
17--- src/schooltool/schoolyear/browser/schoolyear.py 2011-03-31 23:50:26 +0000
18+++ src/schooltool/schoolyear/browser/schoolyear.py 2011-04-19 05:20:55 +0000
19@@ -119,6 +119,18 @@
20 index_title = _("School Years")
21 error = None
22
23+ @property
24+ def first(self):
25+ year = self.context.getActiveSchoolYear()
26+ if year is not None:
27+ return year.first
28+
29+ @property
30+ def last(self):
31+ year = self.context.getActiveSchoolYear()
32+ if year is not None:
33+ return year.last
34+
35 def setUpTableFormatter(self, formatter):
36 columns_before = []
37 if self.canModify():
38
39=== modified file 'src/schooltool/schoolyear/browser/templates/schoolyear_container.pt'
40--- src/schooltool/schoolyear/browser/templates/schoolyear_container.pt 2010-09-15 13:52:08 +0000
41+++ src/schooltool/schoolyear/browser/templates/schoolyear_container.pt 2011-04-19 05:20:55 +0000
42@@ -22,9 +22,9 @@
43 <p i18n:translate="">
44 The active school year is
45 <strong tal:content="active_year/@@title" i18n:name="year" />
46- (<tal:block content="active_year/first/@@mediumDate"
47+ (<tal:block content="view/first/@@mediumDate"
48 i18n:name="start_date"/> -
49- <tal:block content="active_year/last/@@mediumDate"
50+ <tal:block content="view/last/@@mediumDate"
51 i18n:name="end_date"/>)
52 </p>
53 </tal:block>

Subscribers

People subscribed via source and target branches