Add bad request response
This commit is contained in:
parent
64d59ec111
commit
611cc0355e
2 changed files with 5 additions and 2 deletions
|
@ -26,7 +26,7 @@
|
|||
BTW欧盟惯例本站使用了Cookie,请理解!
|
||||
</p>
|
||||
<p>
|
||||
此外里瓣书影音现处于“公开阿尔法测试”阶段,您的数据存在丢失的可能。使用过程中遇到的问题或者Bug欢迎向<a href="https://donotban.com/@whitiewhite">作者</a>提出。
|
||||
此外NiceDB书影音现处于“公开阿尔法测试”阶段,您的数据存在丢失的可能。使用过程中遇到的问题或者Bug欢迎向<a href="https://donotban.com/@whitiewhite">作者</a>提出。
|
||||
</p>
|
||||
<form action="{% url 'users:register' %}" method="post">
|
||||
{% csrf_token %}
|
||||
|
|
|
@ -34,7 +34,10 @@ def OAuth2_login(request):
|
|||
site = request.COOKIES.get('mastodon_domain')
|
||||
|
||||
# Network IO
|
||||
token = obtain_token(site, request, code)
|
||||
try:
|
||||
token = obtain_token(site, request, code)
|
||||
except ObjectDoesNotExist:
|
||||
return HttpResponseBadRequest("Mastodon site not registered")
|
||||
if token:
|
||||
# oauth is completed when token aquired
|
||||
user = authenticate(request, token=token, site=site)
|
||||
|
|
Loading…
Add table
Reference in a new issue