Thanks for the advice. The problem does indeed not occur with another
plugin layout (I used Whitelight before).

I am just testing some functionality and will add a form statement
soon.

On Apr 3, 3:56 am, Massimo Di Pierro <massimo.dipie...@gmail.com>
wrote:
> Add a print statement. You find that the function is being called
> twice. A broken link in the page like <img src="broken"/> make cause
> that.
>
> Mind that a function that inserts without a form posting is vulnerable
> to URL redirection attacks.
>
> On Apr 2, 4:55 pm, Serbitar <rserbi...@googlemail.com> wrote:
>
>
>
>
>
>
>
> > I have the controller:
>
> > @auth.requires_login()
> > def roll():
> >     if request.args(0):
> >         step = int(request.args(0))
> >     else:
> >         return dict(message = "Roll it!")
> >     if request.args(1):
> >         visible = False
> >     else:
> >         visible = True
> >     result = util.roll_step(step)
> >     db.live.insert(username=auth.user.username, value=result,
> > step=step, visible=visible)
> >     return dict(message = result)
>
> > the util.step function just generates some random numbers.
>
> > when I call:
>
> > application/controller/roll/5
>
> > the roll() function inserts ONE entry into the db with visible is True
> > (just like intended)
>
> > when I call:
>
> > application/controller/roll/5/1
>
> > or
>
> > application/controller/roll/10/3/10
>
> > or
>
> > application/controller/roll/7/whatever
>
> > the function inserts TWO entries into the db (with visible = False,
> > like intended). Why does it insert two?
>
> > Thanks in advance.

Reply via email to