Is the user logged in? If the user is not logged in this is the
intended behavior.

Massimo

On Feb 22, 5:19 pm, Bruce Wade <[email protected]> wrote:
> When using user_signature=True in a form that action goes to another method
> and that method has @auth.requires_signature I am getting access denied, if
> I remove the @auth.requires_signature I still see the signature but don't
> have the access denied message.
>
> FORM:
> # adviewer.viewads();
>
> locationform=FORM(
>         DIV(
>             SELECT(countries_options,_id='by-country',_name='country',
> _onchange="updateProvinces(this)", value=selected_country),
>             _id='country_options', _class='filter-selects'
>         ),
>         DIV(
>             SELECT(provinces_options,_id='by-province',
> _name='province_state',_onchange="updateCities(this)",
> value=selected_province),
>             _id='province_options', _class='filter-selects'
>         ),
>         DIV(SELECT(
>             cities_options,_id='by-province', _name='city',
> value=selected_city),
>             _id='city_options', _class='filter-selects'
>         ),
>         DIV(_class='clear'),
>         INPUT(_type='submit', _value='Save', _class='filter-btn'),
>         _name='locationform',
>         _action=URL('adviewer','savesettings/location', user_signature=True)
>     )
>
> Capture Method:
> # adviewer.savesettings()
> // URL submitted to this 
> method:http://127.0.0.1:8000/zh/adviewer/savesettings/location?_signature=82...
> @auth.requires_login()
> @auth.requires_signature()  # If I remove this there is no access denied.
> def savesettings():
>     print request.vars
>     print request.args(0)
>     from youadAPI.adviewer_api import AdViewerEngine
>     if request.args(0) == 'location':
>         adviewer_engine.update_or_create_adviewer_settings(
>             AdViewerEngine.location,
>             dict(
>                  country=request.vars['country'],
>                  province=request.vars['province_state'],
>                  city=request.vars['city']
>             )
>         )
>     elif request.args(0) == 'language':
>         adviewer_engine.update_or_create_adviewer_settings(
>             AdViewerEngine.language,
>             dict(
>                 language = request.vars['language']
>             )
>         )
>     elif request.args(0) == 'keywords':
>         adviewer_engine.update_or_create_adviewer_settings(
>             AdViewerEngine.keywords,
>             dict(
>                 keywords = request.vars['keywords']
>             )
>         )
>
> --
> --
> Regards,
> Bruce 
> Wadehttp://ca.linkedin.com/in/brucelwadehttp://www.wadecybertech.comhttp://www.warplydesigned.comhttp://www.fitnessfriendsfinder.com

Reply via email to