谷歌应用引擎1.8中的用户类

2024-04-20 13:45:18 发布

您现在位置:Python中文网/ 问答频道 /正文

升级到最新的python gae-1.8后,我在appspot.com上遇到以下错误:

AttributeError: 'NoneType' object has no attribute 'email'

同样的代码在dev服务器上运行良好。你知道吗

实际代码为:

entity.username = users.GetCurrentUser().email()

我尝试了最初的get_current_user()函数,但得到了相同的结果。你知道吗

应用程序不是公共的。它已配置为仅在特定应用程序域中工作。而且它在1.7.5版本上运行良好。你知道吗

我只使用一个帐户来避免多个帐户的问题。你知道吗

谢谢你的帮助。你知道吗


Tags: no代码devcom应用程序objectemail错误
1条回答
网友
1楼 · 发布于 2024-04-20 13:45:18

get\u current\u user()的文档说

get_current_user() Returns the User object for the current user (the user who made the request being processed) if the user is signed in, or None if the user is not signed in

如果您的错误是AttributeError: 'NoneType' object has no attribute 'email',那么用户没有登录,并且调用没有返回任何结果。你知道吗

我正在使用一个特定的应用程序域的身份验证,一切正常。所以我不认为这是一个通用的运行时(1.8.0)问题。你知道吗

相关问题 更多 >