Changeset 8974


Ignore:
Timestamp:
11 Jul 2012, 16:36:26 (12 years ago)
Author:
uli
Message:

Tiny code cleanup.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py

    r8972 r8974  
    15941594            self.flash(_('Activation code is invalid.'))
    15951595            return
     1596        if code.state == USED:
     1597            self.flash(_('Activation code has already been used.'))
     1598            return
    15961599        # Mark pin as used (this also fires a pin related transition)
    15971600        # and fire transition start_clearance
    1598         if code.state == USED:
    1599             self.flash(_('Activation code has already been used.'))
    1600             return
    1601         else:
    1602             comment = _(u"invalidated")
    1603             # Here we know that the ac is in state initialized so we do not
    1604             # expect an exception, but the owner might be different
    1605             if not invalidate_accesscode(pin,comment,self.context.student_id):
    1606                 self.flash(_('You are not the owner of this access code.'))
    1607                 return
    1608             self.context.clr_code = pin
     1601        comment = _(u"invalidated")
     1602        # Here we know that the ac is in state initialized so we do not
     1603        # expect an exception, but the owner might be different
     1604        if not invalidate_accesscode(pin, comment, self.context.student_id):
     1605            self.flash(_('You are not the owner of this access code.'))
     1606            return
     1607        self.context.clr_code = pin
    16091608        IWorkflowInfo(self.context).fireTransition('start_clearance')
    16101609        self.flash(_('Clearance process has been started.'))
     
    16231622    def form_fields(self):
    16241623        if self.context.is_postgrad:
    1625             form_fields = grok.AutoFields(IPGStudentClearance).omit('clearance_locked')
    1626         else:
    1627             form_fields = grok.AutoFields(IUGStudentClearance).omit('clearance_locked')
     1624            form_fields = grok.AutoFields(IPGStudentClearance).omit(
     1625                'clearance_locked')
     1626        else:
     1627            form_fields = grok.AutoFields(IUGStudentClearance).omit(
     1628                'clearance_locked')
    16281629        return form_fields
    16291630
Note: See TracChangeset for help on using the changeset viewer.