我有这个代码:
if not selected_organization in request.user.organizations.all():
return Http404
在返回http 404时,我收到以下消息:
type object 'Http404' has no attribute 'get'
我有这个代码:
if not selected_organization in request.user.organizations.all():
return Http404
在返回http 404时,我收到以下消息:
type object 'Http404' has no attribute 'get'
我花了一段时间才弄明白,
最后我还是要raise
的Http404
,而不是return
吧!