Ok, I have found an answer.
There has been another open app (myapp1) in this browser window.
py4web users myapp1, does not ask for a login and tries to get the user
from myapp.

i think this behavior is not wanted.


*I summarize: a user is registered on app1. If app2 is now opened, no new
login is required.*

Am Di., 11. Feb. 2020 um 09:02 Uhr schrieb Martin Weissenboeck <
mweis...@gmail.com>:

>
> py4web 0.1.20200210.2 installed
> Created "myapp" from scaffold
> Tried 127.0.0.1:8000/myapp
>
> Error:
>
> Traceback (most recent call last):
>
>   File "C:\Python37\lib\site-packages\py4web\core.py", line 547, in wrapper
>
>     ret = func(*func_args, **func_kwargs)
>
>   File "C:\Python37\lib\site-packages\py4web\core.py", line 508, in wrapper
>
>     ret = func(*args, **kwargs)
>
>   File "apps\myapp\controllers.py", line 36, in index
>
>     message = T("Hello {first_name}".format(**user))
>
> KeyError: 'first_name'
>
>
> I think the app needs at first a registered user, but @authenticated()
> does not ask for.
>
> @authenticated()
> def index():
>     user = auth.get_user()
>     message = T("Hello {first_name}".format(**user))
>     return dict(message=message, user=user)
>
>
> Regards Martin
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/CAMcwXCcZA8W5EVH0rcWvOeYAHwkqPceVgioL%2BvK9m2OJQc1vWg%40mail.gmail.com.

Reply via email to