Changeset 6383 for main


Ignore:
Timestamp:
16 Jun 2011, 20:38:36 (14 years ago)
Author:
Henrik Bettermann
Message:

accesscodes.invalidate_accesscode(): return false if ac doesn't exist

Use this in browser.py to flash message in addApplicant if ac doesn't exist.

Use a view icon for view tabs.

Location:
main/waeup.sirp/trunk/src/waeup/sirp
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/accesscodes/accesscodes.py

    r6380 r6383  
    468468    """
    469469    ac = get_access_code(access_code)
    470     info = IWorkflowInfo(ac)
    471     return _fire_transition(info, 'use')
     470    if ac:
     471        info = IWorkflowInfo(ac)
     472        return _fire_transition(info, 'use')
     473    else:
     474        False
    472475
    473476def disable_accesscode(access_code):
  • main/waeup.sirp/trunk/src/waeup/sirp/applicants/browser.py

    r6377 r6383  
    478478        ac_number = self.request.form.get('form.ac_number', None)
    479479        pin = '%s-%s-%s' % (self.ac_prefix,ac_series,ac_number)
    480         if pin not in self.context.keys():
     480        if not invalidate_accesscode(pin):
     481            self.flash('%s is not a valid access code.' % pin)
     482            self.redirect(self.url(self.context, '@@manage')+'#tab-2')
     483            return
     484        else:
    481485            # Create applicant record
    482486            applicant = Applicant()
     
    647651        return pdf.getpdfdata()
    648652
    649 class ApplicantsManageActionButton(ManageActionButton):
     653class ApplicantManageActionButton(ManageActionButton):
    650654    grok.context(IApplicant)
    651655    grok.view(DisplayApplicant)
    652656    grok.require('waeup.manageApplications')
    653     text = 'Edit application record'
     657    text = 'Manage application record'
    654658    target = 'edit_full'
    655659
     
    779783class ApplicantViewActionButton(ManageActionButton):
    780784    grok.context(IApplicant)
    781     grok.view(EditApplicantStudent)
    782     grok.require('waeup.handleApplication')
     785    grok.view(EditApplicantFull)
     786    icon = 'actionicon_view.png'
    783787    text = 'View application record'
    784788    target = 'index'
  • main/waeup.sirp/trunk/src/waeup/sirp/applicants/browser_templates/applicantscontainermanagepage.pt

    r6345 r6383  
    8989          </tr>
    9090        </tbody>
    91       </table>
     91      </table><br /><br />
    9292      <div id="actionsView">
    9393        <span class="actionButtons" tal:condition="view/availableActions">
Note: See TracChangeset for help on using the changeset viewer.