Changeset 4432 for TI05-delivery


Ignore:
Timestamp:
17/11/08 17:30:42 (11 years ago)
Author:
cbyrom
Message:

Add inputs checking to avoid unecessary errors being thrown when revisiting
page in wrong state - instead redirect back to home page.

Location:
TI05-delivery/ows_framework/trunk/ows_server/ows_server
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • TI05-delivery/ows_framework/trunk/ows_server/ows_server/controllers/listatom.py

    r4348 r4432  
    7575                c.searchData = searchData 
    7676                self.__setup() 
    77                 atomTypeID = inputs.get('atomTypeID').split('--')[1] 
    78                 providerID = inputs.get('providerID').split('--')[1] 
     77                atomTypeID = inputs.get('atomTypeID') 
     78                providerID = inputs.get('providerID') 
     79                # NB, avoid page being reloaded in incorrect state - e.g. after 
     80                # browser reload 
     81                if not (atomTypeID and providerID): 
     82                    return self.atomHome() 
     83                     
     84                atomTypeID = atomTypeID.split('--')[1] 
     85                providerID = providerID.split('--')[1] 
    7986                c.results = self.searchAtoms(providerID, atomTypeID, inputs.get('title')) 
    8087                 
  • TI05-delivery/ows_framework/trunk/ows_server/ows_server/templates/atom_home.html

    r4420 r4432  
    2020                                </h2> 
    2121                            <h2> 
    22                             <a href="${h.url_for(controller='listatom',action='list')}">Edit/List atoms</a> 
     22                            <a href="${h.url_for(controller='listatom',action='list', searchData=None)}">Edit/List atoms</a> 
    2323                            </h2> 
    2424                            <h2> 
Note: See TracChangeset for help on using the changeset viewer.