~aelkner/schooltool/january_fixes

« back to all changes in this revision

Viewing changes to src/schooltool/schoolyear/schoolyear.py

  • Committer: Gediminas Paulauskas
  • Date: 2009-12-30 17:38:37 UTC
  • mfrom: (2532.1.44 schooltool_makefile)
  • Revision ID: menesis@pov.lt-20091230173837-tbvd13wlmvvochmo
Port to Zope versions available in Karmic (LP: #498803)

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
 
24
24
from zope.proxy import sameProxiedObjects
25
25
from zope.event import notify
26
 
from zope.exceptions.interfaces import UserError
27
26
from zope.component import queryUtility
28
27
from zope.component import adapter
29
28
from zope.component import adapts
191
190
    def __setitem__(self, key, term):
192
191
        self.validateForOverlap(term)
193
192
        if term.first < self.first:
194
 
            raise UserError("Term can't start before the school year starts!")
 
193
            raise ValueError("Term can't start before the school year starts!")
195
194
        if term.last > self.last:
196
 
            raise UserError("Term can't end after the school year ends!")
 
195
            raise ValueError("Term can't end after the school year ends!")
197
196
        BTreeContainer.__setitem__(self, key, term)
198
197
 
199
198