Massimo,

Thank you for the quick reply. That's good info and I will keep it in
mind.

My view does not load any images from my own server. The only <img>
tag references an absolute URL on another host.

This morning, I am wondering if the second reference is caused by the
barcode scanner on the phone, loading the page once in order to decide
whether to call the browser... which loads the page a second time.

-- Art Z.

On Jan 20, 9:36 pm, Massimo Di Pierro <[email protected]>
wrote:
> Look in the view for an incorrect link like
>
> <img src="xxx"/>
>
> if it is a relavive url it would actually call /app/default/index/xxx
> and index is called twice.
>
> On Jan 20, 8:44 pm, Art Zemon <[email protected]> wrote:
>
>
>
>
>
>
>
> > Hello,
>
> > I have a simple function in a controller and it seems to be getting
> > called twice. Any ideas why, and what to do about it?
>
> >     def index():
> >          try:
> >              rows = db(  (db.gtsign.auth_user_id==request.vars['c']) \
> >     & (db.gtsign.id==request.vars['s']) \
> >     & (db.gtsign.auth_user_id==db.auth_user.id)).select()
> >              auth_user=rows.first().auth_user
> >              gtsign=rows.first().gtsign
> >              pattern = re.compile(r'[^\d]')
> >              phoneDigits = pattern.sub('', auth_user.telephone)
>
> >              use_count = gtsign.use_count + 1
> >              db.gtsign[gtsign.id] = dict(use_count=use_count)
>
> >              return dict(gtsign=gtsign, auth_user=auth_user,
> >     phoneDigits=phoneDigits)
> >          except Exception, err:
> >              redirect(URL('invalid'))
>
> > The symptom is that gtsign.use_count is going up by 2 instead of by 1
> > every time the page is loaded from a mobile phone. I see this in the
> > Apache log file:
>
> >     97.87.95.138 - - [20/Jan/2011:20:20:40 -0600] "GET
> >     //gotosigns/?c=1&s=19 HTTP/1.1" 200 1500 "-" "Mozilla/5.0 (Linux; U;
> >     Android 2.1-update1; en-us; SPH-D700 Build/ECLAIR)
> >     AppleWebKit/530.17 (KHTML, like Gecko) Version/4.0 Mobile Safari/530.17"
>
> >     97.87.95.138 - - [20/Jan/2011:20:20:40 -0600] "HEAD
> >     //gotosigns/?c=1&s=19 HTTP/1.1" 200 590 "-" "Mozilla/5.0 (Linux; U;
> >     Android 2.1-update1; en-us; SPH-D700 Build/ECLAIR)
> >     AppleWebKit/530.17 (KHTML, like Gecko) Version/4.0 Mobile Safari/530.17"
>
> > I am running web2py Version 1.91.6 (2011-01-03 17:55:14) on Linux and
> > Apache with mod_wsgi.
>
> > Thanks,
> >      -- Art Z.

Reply via email to