Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server Error (500) #2868

Closed
wangjunking opened this issue Jul 2, 2019 · 2 comments

Comments

Projects
None yet
3 participants
@wangjunking
Copy link

commented Jul 2, 2019

[简述你的问题]

使用版本

1.3.3

问题复现步骤
  1. 网页登录提示Server Error (500)

报错:[exception ERROR] Internal Server Error: /users/login/
Traceback (most recent call last):
File "/usr/local/python-3.6.4/lib/python3.6/site-packages/django/core/handlers/exception.py", line 41, in inner
response = get_response(request)
File "/usr/local/python-3.6.4/lib/python3.6/site-packages/django/core/handlers/base.py", line 187, in _get_response
response = self.process_exception_by_middleware(e, request)
File "/usr/local/python-3.6.4/lib/python3.6/site-packages/django/core/handlers/base.py", line 185, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/usr/local/python-3.6.4/lib/python3.6/contextlib.py", line 52, in inner
return func(*args, **kwds)
File "/usr/local/python-3.6.4/lib/python3.6/site-packages/django/views/generic/base.py", line 68, in view
return self.dispatch(request, *args, **kwargs)
File "/usr/local/python-3.6.4/lib/python3.6/site-packages/django/utils/decorators.py", line 67, in _wrapper
return bound_func(*args, **kwargs)
File "/usr/local/python-3.6.4/lib/python3.6/site-packages/django/views/decorators/debug.py", line 76, in sensitive_post_parameters_wrapper
return view(request, *args, **kwargs)
File "/usr/local/python-3.6.4/lib/python3.6/site-packages/django/utils/decorators.py", line 63, in bound_func
return func.get(self, type(self))(*args2, **kwargs2)
File "/usr/local/python-3.6.4/lib/python3.6/site-packages/django/utils/decorators.py", line 67, in _wrapper
return bound_func(*args, **kwargs)
File "/usr/local/python-3.6.4/lib/python3.6/site-packages/django/utils/decorators.py", line 149, in _wrapped_view
response = view_func(request, *args, **kwargs)
File "/usr/local/python-3.6.4/lib/python3.6/site-packages/django/utils/decorators.py", line 63, in bound_func
return func.get(self, type(self))(*args2, **kwargs2)
File "/usr/local/python-3.6.4/lib/python3.6/site-packages/django/utils/decorators.py", line 67, in _wrapper
return bound_func(*args, **kwargs)
File "/usr/local/python-3.6.4/lib/python3.6/site-packages/django/views/decorators/cache.py", line 57, in _wrapped_view_func
response = view_func(request, *args, **kwargs)
File "/usr/local/python-3.6.4/lib/python3.6/site-packages/django/utils/decorators.py", line 63, in bound_func
return func.get(self, type(self))(*args2, **kwargs2)
File "/usr/local/python-3.6.4/lib/python3.6/site-packages/django/views/generic/base.py", line 88, in dispatch
return handler(request, *args, **kwargs)
File "/usr/local/jumpserver/jumpserver/apps/users/views/login.py", line 73, in post
return super().post(request, *args, **kwargs)
File "/usr/local/python-3.6.4/lib/python3.6/site-packages/django/views/generic/edit.py", line 183, in post
return self.form_valid(form)
File "/usr/local/jumpserver/jumpserver/apps/users/views/login.py", line 80, in form_valid
return redirect(self.get_success_url())
File "/usr/local/jumpserver/jumpserver/apps/users/views/login.py", line 121, in get_success_url
self.write_login_log()
TypeError: write_login_log() missing 1 required positional argument: 'data'

但是添加data参数后,报错提示为:
[exception ERROR] Internal Server Error: /users/login/
Traceback (most recent call last):
File "/usr/local/python-3.6.4/lib/python3.6/site-packages/django/core/handlers/exception.py", line 41, in inner
response = get_response(request)
File "/usr/local/python-3.6.4/lib/python3.6/site-packages/django/core/handlers/base.py", line 187, in _get_response
response = self.process_exception_by_middleware(e, request)
File "/usr/local/python-3.6.4/lib/python3.6/site-packages/django/core/handlers/base.py", line 185, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/usr/local/python-3.6.4/lib/python3.6/contextlib.py", line 52, in inner
return func(*args, **kwds)
File "/usr/local/python-3.6.4/lib/python3.6/site-packages/django/views/generic/base.py", line 68, in view
return self.dispatch(request, *args, **kwargs)
File "/usr/local/python-3.6.4/lib/python3.6/site-packages/django/utils/decorators.py", line 67, in _wrapper
return bound_func(*args, **kwargs)
File "/usr/local/python-3.6.4/lib/python3.6/site-packages/django/views/decorators/debug.py", line 76, in sensitive_post_parameters_wrapper
return view(request, *args, **kwargs)
File "/usr/local/python-3.6.4/lib/python3.6/site-packages/django/utils/decorators.py", line 63, in bound_func
return func.get(self, type(self))(*args2, **kwargs2)
File "/usr/local/python-3.6.4/lib/python3.6/site-packages/django/utils/decorators.py", line 67, in _wrapper
return bound_func(*args, **kwargs)
File "/usr/local/python-3.6.4/lib/python3.6/site-packages/django/utils/decorators.py", line 149, in _wrapped_view
response = view_func(request, *args, **kwargs)
File "/usr/local/python-3.6.4/lib/python3.6/site-packages/django/utils/decorators.py", line 63, in bound_func
return func.get(self, type(self))(*args2, **kwargs2)
File "/usr/local/python-3.6.4/lib/python3.6/site-packages/django/utils/decorators.py", line 67, in _wrapper
return bound_func(*args, **kwargs)
File "/usr/local/python-3.6.4/lib/python3.6/site-packages/django/views/decorators/cache.py", line 57, in _wrapped_view_func
response = view_func(request, *args, **kwargs)
File "/usr/local/python-3.6.4/lib/python3.6/site-packages/django/utils/decorators.py", line 63, in bound_func
return func.get(self, type(self))(*args2, **kwargs2)
File "/usr/local/python-3.6.4/lib/python3.6/site-packages/django/views/generic/base.py", line 88, in dispatch
return handler(request, *args, **kwargs)
File "/usr/local/jumpserver/jumpserver/apps/users/views/login.py", line 73, in post
return super().post(request, *args, **kwargs)
File "/usr/local/python-3.6.4/lib/python3.6/site-packages/django/views/generic/edit.py", line 183, in post
return self.form_valid(form)
File "/usr/local/jumpserver/jumpserver/apps/users/views/login.py", line 80, in form_valid
return redirect(self.get_success_url())
File "/usr/local/jumpserver/jumpserver/apps/users/views/login.py", line 121, in get_success_url
self.write_login_log(data)
UnboundLocalError: local variable 'data' referenced before assignment

请问这是什么问题,请大神帮忙分析下什么问题,感谢!

[注:] 完成后请关闭 issue

@zhimin-fit2cloud

This comment has been minimized.

Copy link

commented Jul 2, 2019

请升级到最新版本。

@jym503558564

This comment has been minimized.

Copy link
Contributor

commented Jul 22, 2019

问题是否已得到解决,如有其它问题,请重新打开issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.