Changeset 612 in tmcsimulator for branches/LCSv1/controllers/default.py
- Timestamp:
- 04/02/2020 09:36:50 AM (6 years ago)
- File:
-
- 1 edited
-
branches/LCSv1/controllers/default.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/LCSv1/controllers/default.py
r610 r612 43 43 INPUT(_name='enddate',_class='date'),BR(), 44 44 INPUT(_value="Search", _type='submit', _class="btn btn-primary btn-default", _style="margin: 7% 45% 2% 40%;")) 45 if form.process( ).accepted:45 if form.process(onvalidation=special_validation).accepted: 46 46 # Put the form fields into the session variables 47 47 session.closureid = form.vars.closureid … … 53 53 redirect(URL('results')) 54 54 return dict(form=form) 55 # Search Form: Special validation check to reject lognum without closureID 56 def special_validation(form): 57 # Error if a lognum was given and no closure id 58 if (len(form.vars.lognum) > 0 and len(form.vars.closureid) == 0): 59 form.errors.lognum = 'Must provide a closureID when specifying a log number' 55 60 # Show the item that was found in the search 56 61 def results():
Note: See TracChangeset
for help on using the changeset viewer.
