Hi Denes,

This is the function:

@auth.requires_login()
def index():
    if auth.user.account!='1':
        redirect(URL(r=request,c='view',f='index'))
    else:
        response.functionname='Business Card'
        return dict()


I also tried:

@auth.requires_login()
def index():
    if auth.user.account!='1':
        redirect(URL(r=request,c='view',f='index'))
    else:
        response.functionname='Business Card'
        box=[]
        return dict(promobox=box)


.. but that resulted in:

Traceback (most recent call last):
  File "/Library/Python/2.5/site-packages/web2py_1.87.3/gluon/
restricted.py", line 188, in restricted
    exec ccode in environment
  File "/Library/Python/2.5/site-packages/web2py_1.87.3/applications/
cms/views/card/index.html", line 137, in <module>
IndexError: list index out of range


Given the last function, this view works:

{{if promobox:}}
  <div class="sidebox">
    {{if promobox[0].kop:}}
      <h3>{{=promobox[0].kop}}</h3>
    {{pass}}
    {{=XML(promobox[0].tekst)}}
  </div> <!-- sidebox -->
{{pass}}


.. so  {{if promobox:}} instead of {{if 'promobox'in globals():}}


I hope I provided you with sufficient information to find out why the
errors occur.


Kind regards,

Annet.

Reply via email to