Congratulations, you have successfully bound your email address. You can use @@ -163,6 +249,8 @@ def emailconfirm(request, id, sign): ''') % {'oauthuser_type': oauthuser.type, 'site': site} send_email(emailto=[oauthuser.email, ], title=_('Congratulations on your successful binding!'), content=content) + + # 跳转到绑定成功页面 url = reverse('oauth:bindsuccess', kwargs={ 'oauthid': id }) @@ -171,12 +259,19 @@ def emailconfirm(request, id, sign): class RequireEmailView(FormView): + """ + 要求邮箱表单视图 + 处理用户补充邮箱信息的流程 + """ form_class = RequireEmailForm template_name = 'oauth/require_email.html' def get(self, request, *args, **kwargs): + """GET请求处理""" oauthid = self.kwargs['oauthid'] oauthuser = get_object_or_404(OAuthUser, pk=oauthid) + + # 如果已有邮箱,可能直接跳转(当前注释掉了) if oauthuser.email: pass # return HttpResponseRedirect('/') @@ -184,6 +279,7 @@ class RequireEmailView(FormView): return super(RequireEmailView, self).get(request, *args, **kwargs) def get_initial(self): + """设置表单初始值""" oauthid = self.kwargs['oauthid'] return { 'email': '', @@ -191,6 +287,7 @@ class RequireEmailView(FormView): } def get_context_data(self, **kwargs): + """添加上下文数据""" oauthid = self.kwargs['oauthid'] oauthuser = get_object_or_404(OAuthUser, pk=oauthid) if oauthuser.picture: @@ -198,13 +295,18 @@ class RequireEmailView(FormView): return super(RequireEmailView, self).get_context_data(**kwargs) def form_valid(self, form): + """表单验证通过后的处理""" email = form.cleaned_data['email'] oauthid = form.cleaned_data['oauthid'] oauthuser = get_object_or_404(OAuthUser, pk=oauthid) oauthuser.email = email oauthuser.save() + + # 生成安全签名 sign = get_sha256(settings.SECRET_KEY + str(oauthuser.id) + settings.SECRET_KEY) + + # 构建确认链接 site = get_current_site().domain if settings.DEBUG: site = '127.0.0.1:8000' @@ -214,6 +316,7 @@ class RequireEmailView(FormView): }) url = "http://{site}{path}".format(site=site, path=path) + # 发送确认邮件 content = _("""
Please click the link below to bind your email
@@ -226,6 +329,8 @@ class RequireEmailView(FormView): %(url)s """) % {'url': url} send_email(emailto=[email, ], title=_('Bind your email'), content=content) + + # 跳转到绑定成功提示页面 url = reverse('oauth:bindsuccess', kwargs={ 'oauthid': oauthid }) @@ -234,8 +339,20 @@ class RequireEmailView(FormView): def bindsuccess(request, oauthid): + """ + 绑定成功提示页面 + + Args: + request: Django请求对象 + oauthid: OAuth用户ID + + Returns: + HttpResponse: 渲染的绑定成功页面 + """ type = request.GET.get('type', None) oauthuser = get_object_or_404(OAuthUser, pk=oauthid) + + # 根据绑定类型显示不同内容 if type == 'email': title = _('Bind your email') content = _( @@ -247,7 +364,9 @@ def bindsuccess(request, oauthid): "Congratulations, you have successfully bound your email address. You can use %(oauthuser_type)s" " to directly log in to this website without a password. You are welcome to continue to follow this site." % { 'oauthuser_type': oauthuser.type}) + return render(request, 'oauth/bindsuccess.html', { 'title': title, 'content': content }) + diff --git a/src/DjangoBlog/oauth_quality_report.json b/src/DjangoBlog/oauth_quality_report.json new file mode 100644 index 0000000..5636a65 --- /dev/null +++ b/src/DjangoBlog/oauth_quality_report.json @@ -0,0 +1,1748 @@ +{ + "project": "OAuth Module", + "analysis_date": "2025-11-09T14:47:37.985231", + "tools_used": [ + "flake8", + "pylint" + ], + "summary": {}, + "flake8_issues": [ + "oauth/admin.py:136:1: W391 blank line at end of file", + "oauth/apps.py:6:1: W391 blank line at end of file", + "oauth/forms.py:40:1: W391 blank line at end of file", + "oauth/models.py:124:1: W391 blank line at end of file", + "oauth/oauthmanager.py:369:1: W391 blank line at end of file", + "oauth/tests.py:91:9: F841 local variable 'url' is assigned to but never used", + "oauth/tests.py:118:9: F841 local variable 'url' is assigned to but never used", + "oauth/tests.py:133:9: F841 local variable 'token' is assigned to but never used", + "oauth/tests.py:152:121: E501 line too long (127 > 120 characters)", + "oauth/tests.py:161:9: F841 local variable 'token' is assigned to but never used", + "oauth/tests.py:194:9: F841 local variable 'token' is assigned to but never used", + "oauth/tests.py:219:9: F841 local variable 'token' is assigned to but never used", + "oauth/tests.py:330:1: W391 blank line at end of file", + "oauth/urls.py:54:1: W391 blank line at end of file", + "oauth/views.py:365:121: E501 line too long (122 > 120 characters)", + "oauth/views.py:372:1: W391 blank line at end of file", + "2 E501 line too long (127 > 120 characters)", + "6 F841 local variable 'url' is assigned to but never used", + "8 W391 blank line at end of file" + ], + "pylint_issues": [ + { + "type": "convention", + "module": "oauth.admin", + "obj": "", + "line": 136, + "column": 0, + "endLine": null, + "endColumn": null, + "path": "oauth\\admin.py", + "symbol": "trailing-newlines", + "message": "Trailing newlines", + "message-id": "C0305" + }, + { + "type": "warning", + "module": "oauth.admin", + "obj": "OAuthUserAdmin.get_readonly_fields", + "line": 62, + "column": 37, + "endLine": 62, + "endColumn": 46, + "path": "oauth\\admin.py", + "symbol": "protected-access", + "message": "Access to a protected member _meta of a client class", + "message-id": "W0212" + }, + { + "type": "warning", + "module": "oauth.admin", + "obj": "OAuthUserAdmin.get_readonly_fields", + "line": 63, + "column": 37, + "endLine": 63, + "endColumn": 46, + "path": "oauth\\admin.py", + "symbol": "protected-access", + "message": "Access to a protected member _meta of a client class", + "message-id": "W0212" + }, + { + "type": "warning", + "module": "oauth.admin", + "obj": "OAuthUserAdmin.link_to_usermodel", + "line": 91, + "column": 20, + "endLine": 91, + "endColumn": 36, + "path": "oauth\\admin.py", + "symbol": "protected-access", + "message": "Access to a protected member _meta of a client class", + "message-id": "W0212" + }, + { + "type": "warning", + "module": "oauth.admin", + "obj": "OAuthUserAdmin.link_to_usermodel", + "line": 91, + "column": 48, + "endLine": 91, + "endColumn": 64, + "path": "oauth\\admin.py", + "symbol": "protected-access", + "message": "Access to a protected member _meta of a client class", + "message-id": "W0212" + }, + { + "type": "convention", + "module": "oauth.admin", + "obj": "OAuthUserAdmin.link_to_usermodel", + "line": 92, + "column": 27, + "endLine": 92, + "endColumn": 47, + "path": "oauth\\admin.py", + "symbol": "consider-using-f-string", + "message": "Formatting a regular string which could be an f-string", + "message-id": "C0209" + }, + { + "type": "convention", + "module": "oauth.admin", + "obj": "OAuthUserAdmin.link_to_usermodel", + "line": 96, + "column": 16, + "endLine": 96, + "endColumn": 38, + "path": "oauth\\admin.py", + "symbol": "consider-using-f-string", + "message": "Formatting a regular string which could be an f-string", + "message-id": "C0209" + }, + { + "type": "warning", + "module": "oauth.admin", + "obj": "", + "line": 96, + "column": 16, + "endLine": null, + "endColumn": null, + "path": "oauth\\admin.py", + "symbol": "redundant-u-string-prefix", + "message": "The u prefix for strings is no longer necessary in Python >=3.0", + "message-id": "W1406" + }, + { + "type": "refactor", + "module": "oauth.admin", + "obj": "OAuthUserAdmin.link_to_usermodel", + "line": 78, + "column": 4, + "endLine": 78, + "endColumn": 25, + "path": "oauth\\admin.py", + "symbol": "inconsistent-return-statements", + "message": "Either all return statements in a function should return an expression, or none of them should.", + "message-id": "R1710" + }, + { + "type": "convention", + "module": "oauth.admin", + "obj": "OAuthUserAdmin.show_user_image", + "line": 112, + "column": 12, + "endLine": 112, + "endColumn": 66, + "path": "oauth\\admin.py", + "symbol": "consider-using-f-string", + "message": "Formatting a regular string which could be an f-string", + "message-id": "C0209" + }, + { + "type": "warning", + "module": "oauth.admin", + "obj": "", + "line": 112, + "column": 12, + "endLine": null, + "endColumn": null, + "path": "oauth\\admin.py", + "symbol": "redundant-u-string-prefix", + "message": "The u prefix for strings is no longer necessary in Python >=3.0", + "message-id": "W1406" + }, + { + "type": "convention", + "module": "oauth.apps", + "obj": "", + "line": 6, + "column": 0, + "endLine": null, + "endColumn": null, + "path": "oauth\\apps.py", + "symbol": "trailing-newlines", + "message": "Trailing newlines", + "message-id": "C0305" + }, + { + "type": "convention", + "module": "oauth.apps", + "obj": "", + "line": 1, + "column": 0, + "endLine": null, + "endColumn": null, + "path": "oauth\\apps.py", + "symbol": "missing-module-docstring", + "message": "Missing module docstring", + "message-id": "C0114" + }, + { + "type": "convention", + "module": "oauth.apps", + "obj": "OauthConfig", + "line": 4, + "column": 0, + "endLine": 4, + "endColumn": 17, + "path": "oauth\\apps.py", + "symbol": "missing-class-docstring", + "message": "Missing class docstring", + "message-id": "C0115" + }, + { + "type": "convention", + "module": "oauth.forms", + "obj": "", + "line": 40, + "column": 0, + "endLine": null, + "endColumn": null, + "path": "oauth\\forms.py", + "symbol": "trailing-newlines", + "message": "Trailing newlines", + "message-id": "C0305" + }, + { + "type": "refactor", + "module": "oauth.forms", + "obj": "RequireEmailForm.__init__", + "line": 32, + "column": 8, + "endLine": 32, + "endColumn": 37, + "path": "oauth\\forms.py", + "symbol": "super-with-arguments", + "message": "Consider using Python 3 style super() without arguments", + "message-id": "R1725" + }, + { + "type": "convention", + "module": "oauth.models", + "obj": "", + "line": 124, + "column": 0, + "endLine": null, + "endColumn": null, + "path": "oauth\\models.py", + "symbol": "trailing-newlines", + "message": "Trailing newlines", + "message-id": "C0305" + }, + { + "type": "refactor", + "module": "oauth.models", + "obj": "OAuthUser.Meta", + "line": 58, + "column": 4, + "endLine": 58, + "endColumn": 14, + "path": "oauth\\models.py", + "symbol": "too-few-public-methods", + "message": "Too few public methods (0/2)", + "message-id": "R0903" + }, + { + "type": "error", + "module": "oauth.models", + "obj": "OAuthConfig.clean", + "line": 111, + "column": 11, + "endLine": 111, + "endColumn": 30, + "path": "oauth\\models.py", + "symbol": "no-member", + "message": "Class 'OAuthConfig' has no 'objects' member", + "message-id": "E1101" + }, + { + "type": "error", + "module": "oauth.models", + "obj": "OAuthConfig.clean", + "line": 112, + "column": 43, + "endLine": 112, + "endColumn": 50, + "path": "oauth\\models.py", + "symbol": "no-member", + "message": "Instance of 'OAuthConfig' has no 'id' member", + "message-id": "E1101" + }, + { + "type": "refactor", + "module": "oauth.models", + "obj": "OAuthConfig.Meta", + "line": 119, + "column": 4, + "endLine": 119, + "endColumn": 14, + "path": "oauth\\models.py", + "symbol": "too-few-public-methods", + "message": "Too few public methods (0/2)", + "message-id": "R0903" + }, + { + "type": "convention", + "module": "oauth.oauthmanager", + "obj": "", + "line": 67, + "column": 0, + "endLine": null, + "endColumn": null, + "path": "oauth\\oauthmanager.py", + "symbol": "line-too-long", + "message": "Line too long (101/100)", + "message-id": "C0301" + }, + { + "type": "convention", + "module": "oauth.oauthmanager", + "obj": "", + "line": 369, + "column": 0, + "endLine": null, + "endColumn": null, + "path": "oauth\\oauthmanager.py", + "symbol": "trailing-newlines", + "message": "Trailing newlines", + "message-id": "C0305" + }, + { + "type": "warning", + "module": "oauth.oauthmanager", + "obj": "OAuthAccessTokenException", + "line": 27, + "column": 4, + "endLine": 27, + "endColumn": 8, + "path": "oauth\\oauthmanager.py", + "symbol": "unnecessary-pass", + "message": "Unnecessary pass statement", + "message-id": "W0107" + }, + { + "type": "warning", + "module": "oauth.oauthmanager", + "obj": "BaseOauthManager.get_authorization_url", + "line": 80, + "column": 8, + "endLine": 80, + "endColumn": 12, + "path": "oauth\\oauthmanager.py", + "symbol": "unnecessary-pass", + "message": "Unnecessary pass statement", + "message-id": "W0107" + }, + { + "type": "warning", + "module": "oauth.oauthmanager", + "obj": "BaseOauthManager.get_access_token_by_code", + "line": 93, + "column": 8, + "endLine": 93, + "endColumn": 12, + "path": "oauth\\oauthmanager.py", + "symbol": "unnecessary-pass", + "message": "Unnecessary pass statement", + "message-id": "W0107" + }, + { + "type": "warning", + "module": "oauth.oauthmanager", + "obj": "BaseOauthManager.get_oauth_userinfo", + "line": 103, + "column": 8, + "endLine": 103, + "endColumn": 12, + "path": "oauth\\oauthmanager.py", + "symbol": "unnecessary-pass", + "message": "Unnecessary pass statement", + "message-id": "W0107" + }, + { + "type": "warning", + "module": "oauth.oauthmanager", + "obj": "BaseOauthManager.get_picture", + "line": 116, + "column": 8, + "endLine": 116, + "endColumn": 12, + "path": "oauth\\oauthmanager.py", + "symbol": "unnecessary-pass", + "message": "Unnecessary pass statement", + "message-id": "W0107" + }, + { + "type": "warning", + "module": "oauth.oauthmanager", + "obj": "BaseOauthManager.do_get", + "line": 130, + "column": 14, + "endLine": 130, + "endColumn": 67, + "path": "oauth\\oauthmanager.py", + "symbol": "missing-timeout", + "message": "Missing timeout argument for method 'requests.get' can cause your program to hang indefinitely", + "message-id": "W3101" + }, + { + "type": "warning", + "module": "oauth.oauthmanager", + "obj": "BaseOauthManager.do_post", + "line": 146, + "column": 14, + "endLine": 146, + "endColumn": 57, + "path": "oauth\\oauthmanager.py", + "symbol": "missing-timeout", + "message": "Missing timeout argument for method 'requests.post' can cause your program to hang indefinitely", + "message-id": "W3101" + }, + { + "type": "error", + "module": "oauth.oauthmanager", + "obj": "BaseOauthManager.get_config", + "line": 157, + "column": 16, + "endLine": 157, + "endColumn": 35, + "path": "oauth\\oauthmanager.py", + "symbol": "no-member", + "message": "Class 'OAuthConfig' has no 'objects' member", + "message-id": "E1101" + }, + { + "type": "refactor", + "module": "oauth.oauthmanager", + "obj": "WBOauthManager.__init__", + "line": 179, + "column": 8, + "endLine": 179, + "endColumn": 35, + "path": "oauth\\oauthmanager.py", + "symbol": "super-with-arguments", + "message": "Consider using Python 3 style super() without arguments", + "message-id": "R1725" + }, + { + "type": "refactor", + "module": "oauth.oauthmanager", + "obj": "WBOauthManager.get_access_token_by_code", + "line": 222, + "column": 8, + "endLine": 227, + "endColumn": 48, + "path": "oauth\\oauthmanager.py", + "symbol": "no-else-return", + "message": "Unnecessary \"else\" after \"return\", remove the \"else\" and de-indent the code inside it", + "message-id": "R1705" + }, + { + "type": "warning", + "module": "oauth.oauthmanager", + "obj": "WBOauthManager.get_oauth_userinfo", + "line": 259, + "column": 15, + "endLine": 259, + "endColumn": 24, + "path": "oauth\\oauthmanager.py", + "symbol": "broad-exception-caught", + "message": "Catching too general exception Exception", + "message-id": "W0718" + }, + { + "type": "warning", + "module": "oauth.oauthmanager", + "obj": "WBOauthManager.get_oauth_userinfo", + "line": 261, + "column": 12, + "endLine": 261, + "endColumn": 56, + "path": "oauth\\oauthmanager.py", + "symbol": "logging-not-lazy", + "message": "Use lazy % formatting in logging functions", + "message-id": "W1201" + }, + { + "type": "warning", + "module": "oauth.oauthmanager", + "obj": "ProxyManagerMixin.__init__", + "line": 284, + "column": 0, + "endLine": null, + "endColumn": null, + "path": "oauth\\oauthmanager.py", + "symbol": "unused-argument", + "message": "Unused argument 'args'", + "message-id": "W0613" + }, + { + "type": "warning", + "module": "oauth.oauthmanager", + "obj": "ProxyManagerMixin.__init__", + "line": 284, + "column": 0, + "endLine": null, + "endColumn": null, + "path": "oauth\\oauthmanager.py", + "symbol": "unused-argument", + "message": "Unused argument 'kwargs'", + "message-id": "W0613" + }, + { + "type": "warning", + "module": "oauth.oauthmanager", + "obj": "ProxyManagerMixin.do_get", + "line": 296, + "column": 14, + "endLine": 296, + "endColumn": 89, + "path": "oauth\\oauthmanager.py", + "symbol": "missing-timeout", + "message": "Missing timeout argument for method 'requests.get' can cause your program to hang indefinitely", + "message-id": "W3101" + }, + { + "type": "warning", + "module": "oauth.oauthmanager", + "obj": "ProxyManagerMixin.do_post", + "line": 302, + "column": 14, + "endLine": 302, + "endColumn": 79, + "path": "oauth\\oauthmanager.py", + "symbol": "missing-timeout", + "message": "Missing timeout argument for method 'requests.post' can cause your program to hang indefinitely", + "message-id": "W3101" + }, + { + "type": "warning", + "module": "oauth.oauthmanager", + "obj": "GoogleOauthManager", + "line": 310, + "column": 0, + "endLine": 310, + "endColumn": 24, + "path": "oauth\\oauthmanager.py", + "symbol": "abstract-method", + "message": "Method 'get_access_token_by_code' is abstract in class 'BaseOauthManager' but is not overridden in child class 'GoogleOauthManager'", + "message-id": "W0223" + }, + { + "type": "warning", + "module": "oauth.oauthmanager", + "obj": "GoogleOauthManager", + "line": 310, + "column": 0, + "endLine": 310, + "endColumn": 24, + "path": "oauth\\oauthmanager.py", + "symbol": "abstract-method", + "message": "Method 'get_authorization_url' is abstract in class 'BaseOauthManager' but is not overridden in child class 'GoogleOauthManager'", + "message-id": "W0223" + }, + { + "type": "warning", + "module": "oauth.oauthmanager", + "obj": "GoogleOauthManager", + "line": 310, + "column": 0, + "endLine": 310, + "endColumn": 24, + "path": "oauth\\oauthmanager.py", + "symbol": "abstract-method", + "message": "Method 'get_oauth_userinfo' is abstract in class 'BaseOauthManager' but is not overridden in child class 'GoogleOauthManager'", + "message-id": "W0223" + }, + { + "type": "warning", + "module": "oauth.oauthmanager", + "obj": "GoogleOauthManager", + "line": 310, + "column": 0, + "endLine": 310, + "endColumn": 24, + "path": "oauth\\oauthmanager.py", + "symbol": "abstract-method", + "message": "Method 'get_picture' is abstract in class 'BaseOauthManager' but is not overridden in child class 'GoogleOauthManager'", + "message-id": "W0223" + }, + { + "type": "warning", + "module": "oauth.oauthmanager", + "obj": "GitHubOauthManager", + "line": 315, + "column": 0, + "endLine": 315, + "endColumn": 24, + "path": "oauth\\oauthmanager.py", + "symbol": "abstract-method", + "message": "Method 'get_access_token_by_code' is abstract in class 'BaseOauthManager' but is not overridden in child class 'GitHubOauthManager'", + "message-id": "W0223" + }, + { + "type": "warning", + "module": "oauth.oauthmanager", + "obj": "GitHubOauthManager", + "line": 315, + "column": 0, + "endLine": 315, + "endColumn": 24, + "path": "oauth\\oauthmanager.py", + "symbol": "abstract-method", + "message": "Method 'get_authorization_url' is abstract in class 'BaseOauthManager' but is not overridden in child class 'GitHubOauthManager'", + "message-id": "W0223" + }, + { + "type": "warning", + "module": "oauth.oauthmanager", + "obj": "GitHubOauthManager", + "line": 315, + "column": 0, + "endLine": 315, + "endColumn": 24, + "path": "oauth\\oauthmanager.py", + "symbol": "abstract-method", + "message": "Method 'get_oauth_userinfo' is abstract in class 'BaseOauthManager' but is not overridden in child class 'GitHubOauthManager'", + "message-id": "W0223" + }, + { + "type": "warning", + "module": "oauth.oauthmanager", + "obj": "GitHubOauthManager", + "line": 315, + "column": 0, + "endLine": 315, + "endColumn": 24, + "path": "oauth\\oauthmanager.py", + "symbol": "abstract-method", + "message": "Method 'get_picture' is abstract in class 'BaseOauthManager' but is not overridden in child class 'GitHubOauthManager'", + "message-id": "W0223" + }, + { + "type": "warning", + "module": "oauth.oauthmanager", + "obj": "FaceBookOauthManager", + "line": 320, + "column": 0, + "endLine": 320, + "endColumn": 26, + "path": "oauth\\oauthmanager.py", + "symbol": "abstract-method", + "message": "Method 'get_access_token_by_code' is abstract in class 'BaseOauthManager' but is not overridden in child class 'FaceBookOauthManager'", + "message-id": "W0223" + }, + { + "type": "warning", + "module": "oauth.oauthmanager", + "obj": "FaceBookOauthManager", + "line": 320, + "column": 0, + "endLine": 320, + "endColumn": 26, + "path": "oauth\\oauthmanager.py", + "symbol": "abstract-method", + "message": "Method 'get_authorization_url' is abstract in class 'BaseOauthManager' but is not overridden in child class 'FaceBookOauthManager'", + "message-id": "W0223" + }, + { + "type": "warning", + "module": "oauth.oauthmanager", + "obj": "FaceBookOauthManager", + "line": 320, + "column": 0, + "endLine": 320, + "endColumn": 26, + "path": "oauth\\oauthmanager.py", + "symbol": "abstract-method", + "message": "Method 'get_oauth_userinfo' is abstract in class 'BaseOauthManager' but is not overridden in child class 'FaceBookOauthManager'", + "message-id": "W0223" + }, + { + "type": "warning", + "module": "oauth.oauthmanager", + "obj": "FaceBookOauthManager", + "line": 320, + "column": 0, + "endLine": 320, + "endColumn": 26, + "path": "oauth\\oauthmanager.py", + "symbol": "abstract-method", + "message": "Method 'get_picture' is abstract in class 'BaseOauthManager' but is not overridden in child class 'FaceBookOauthManager'", + "message-id": "W0223" + }, + { + "type": "warning", + "module": "oauth.oauthmanager", + "obj": "QQOauthManager", + "line": 325, + "column": 0, + "endLine": 325, + "endColumn": 20, + "path": "oauth\\oauthmanager.py", + "symbol": "abstract-method", + "message": "Method 'get_access_token_by_code' is abstract in class 'BaseOauthManager' but is not overridden in child class 'QQOauthManager'", + "message-id": "W0223" + }, + { + "type": "warning", + "module": "oauth.oauthmanager", + "obj": "QQOauthManager", + "line": 325, + "column": 0, + "endLine": 325, + "endColumn": 20, + "path": "oauth\\oauthmanager.py", + "symbol": "abstract-method", + "message": "Method 'get_authorization_url' is abstract in class 'BaseOauthManager' but is not overridden in child class 'QQOauthManager'", + "message-id": "W0223" + }, + { + "type": "warning", + "module": "oauth.oauthmanager", + "obj": "QQOauthManager", + "line": 325, + "column": 0, + "endLine": 325, + "endColumn": 20, + "path": "oauth\\oauthmanager.py", + "symbol": "abstract-method", + "message": "Method 'get_oauth_userinfo' is abstract in class 'BaseOauthManager' but is not overridden in child class 'QQOauthManager'", + "message-id": "W0223" + }, + { + "type": "warning", + "module": "oauth.oauthmanager", + "obj": "QQOauthManager", + "line": 325, + "column": 0, + "endLine": 325, + "endColumn": 20, + "path": "oauth\\oauthmanager.py", + "symbol": "abstract-method", + "message": "Method 'get_picture' is abstract in class 'BaseOauthManager' but is not overridden in child class 'QQOauthManager'", + "message-id": "W0223" + }, + { + "type": "error", + "module": "oauth.oauthmanager", + "obj": "get_oauth_apps", + "line": 338, + "column": 14, + "endLine": 338, + "endColumn": 33, + "path": "oauth\\oauthmanager.py", + "symbol": "no-member", + "message": "Class 'OAuthConfig' has no 'objects' member", + "message-id": "E1101" + }, + { + "type": "error", + "module": "oauth.oauthmanager", + "obj": "get_oauth_apps", + "line": 349, + "column": 12, + "endLine": 349, + "endColumn": 15, + "path": "oauth\\oauthmanager.py", + "symbol": "abstract-class-instantiated", + "message": "Abstract class 'GoogleOauthManager' with abstract methods instantiated", + "message-id": "E0110" + }, + { + "type": "error", + "module": "oauth.oauthmanager", + "obj": "get_oauth_apps", + "line": 349, + "column": 12, + "endLine": 349, + "endColumn": 15, + "path": "oauth\\oauthmanager.py", + "symbol": "abstract-class-instantiated", + "message": "Abstract class 'GitHubOauthManager' with abstract methods instantiated", + "message-id": "E0110" + }, + { + "type": "error", + "module": "oauth.oauthmanager", + "obj": "get_oauth_apps", + "line": 349, + "column": 12, + "endLine": 349, + "endColumn": 15, + "path": "oauth\\oauthmanager.py", + "symbol": "abstract-class-instantiated", + "message": "Abstract class 'FaceBookOauthManager' with abstract methods instantiated", + "message-id": "E0110" + }, + { + "type": "error", + "module": "oauth.oauthmanager", + "obj": "get_oauth_apps", + "line": 349, + "column": 12, + "endLine": 349, + "endColumn": 15, + "path": "oauth\\oauthmanager.py", + "symbol": "abstract-class-instantiated", + "message": "Abstract class 'QQOauthManager' with abstract methods instantiated", + "message-id": "E0110" + }, + { + "type": "error", + "module": "oauth.oauthmanager", + "obj": "get_oauth_apps", + "line": 349, + "column": 41, + "endLine": 349, + "endColumn": 44, + "path": "oauth\\oauthmanager.py", + "symbol": "abstract-class-instantiated", + "message": "Abstract class 'GoogleOauthManager' with abstract methods instantiated", + "message-id": "E0110" + }, + { + "type": "error", + "module": "oauth.oauthmanager", + "obj": "get_oauth_apps", + "line": 349, + "column": 41, + "endLine": 349, + "endColumn": 44, + "path": "oauth\\oauthmanager.py", + "symbol": "abstract-class-instantiated", + "message": "Abstract class 'GitHubOauthManager' with abstract methods instantiated", + "message-id": "E0110" + }, + { + "type": "error", + "module": "oauth.oauthmanager", + "obj": "get_oauth_apps", + "line": 349, + "column": 41, + "endLine": 349, + "endColumn": 44, + "path": "oauth\\oauthmanager.py", + "symbol": "abstract-class-instantiated", + "message": "Abstract class 'FaceBookOauthManager' with abstract methods instantiated", + "message-id": "E0110" + }, + { + "type": "error", + "module": "oauth.oauthmanager", + "obj": "get_oauth_apps", + "line": 349, + "column": 41, + "endLine": 349, + "endColumn": 44, + "path": "oauth\\oauthmanager.py", + "symbol": "abstract-class-instantiated", + "message": "Abstract class 'QQOauthManager' with abstract methods instantiated", + "message-id": "E0110" + }, + { + "type": "warning", + "module": "oauth.oauthmanager", + "obj": "get_manager_by_type", + "line": 353, + "column": 24, + "endLine": 353, + "endColumn": 28, + "path": "oauth\\oauthmanager.py", + "symbol": "redefined-builtin", + "message": "Redefining built-in 'type'", + "message-id": "W0622" + }, + { + "type": "convention", + "module": "oauth.tests", + "obj": "", + "line": 152, + "column": 0, + "endLine": null, + "endColumn": null, + "path": "oauth\\tests.py", + "symbol": "line-too-long", + "message": "Line too long (127/100)", + "message-id": "C0301" + }, + { + "type": "convention", + "module": "oauth.tests", + "obj": "", + "line": 300, + "column": 0, + "endLine": null, + "endColumn": null, + "path": "oauth\\tests.py", + "symbol": "line-too-long", + "message": "Line too long (104/100)", + "message-id": "C0301" + }, + { + "type": "convention", + "module": "oauth.tests", + "obj": "", + "line": 320, + "column": 0, + "endLine": null, + "endColumn": null, + "path": "oauth\\tests.py", + "symbol": "line-too-long", + "message": "Line too long (111/100)", + "message-id": "C0301" + }, + { + "type": "convention", + "module": "oauth.tests", + "obj": "", + "line": 330, + "column": 0, + "endLine": null, + "endColumn": null, + "path": "oauth\\tests.py", + "symbol": "trailing-newlines", + "message": "Trailing newlines", + "message-id": "C0305" + }, + { + "type": "error", + "module": "oauth.tests", + "obj": "OauthLoginTest.init_apps", + "line": 66, + "column": 24, + "endLine": 66, + "endColumn": 27, + "path": "oauth\\tests.py", + "symbol": "abstract-class-instantiated", + "message": "Abstract class 'GoogleOauthManager' with abstract methods instantiated", + "message-id": "E0110" + }, + { + "type": "error", + "module": "oauth.tests", + "obj": "OauthLoginTest.init_apps", + "line": 66, + "column": 24, + "endLine": 66, + "endColumn": 27, + "path": "oauth\\tests.py", + "symbol": "abstract-class-instantiated", + "message": "Abstract class 'GitHubOauthManager' with abstract methods instantiated", + "message-id": "E0110" + }, + { + "type": "error", + "module": "oauth.tests", + "obj": "OauthLoginTest.init_apps", + "line": 66, + "column": 24, + "endLine": 66, + "endColumn": 27, + "path": "oauth\\tests.py", + "symbol": "abstract-class-instantiated", + "message": "Abstract class 'FaceBookOauthManager' with abstract methods instantiated", + "message-id": "E0110" + }, + { + "type": "error", + "module": "oauth.tests", + "obj": "OauthLoginTest.init_apps", + "line": 66, + "column": 24, + "endLine": 66, + "endColumn": 27, + "path": "oauth\\tests.py", + "symbol": "abstract-class-instantiated", + "message": "Abstract class 'QQOauthManager' with abstract methods instantiated", + "message-id": "E0110" + }, + { + "type": "warning", + "module": "oauth.tests", + "obj": "OauthLoginTest.get_app_by_type", + "line": 76, + "column": 30, + "endLine": 76, + "endColumn": 34, + "path": "oauth\\tests.py", + "symbol": "redefined-builtin", + "message": "Redefining built-in 'type'", + "message-id": "W0622" + }, + { + "type": "refactor", + "module": "oauth.tests", + "obj": "OauthLoginTest.get_app_by_type", + "line": 76, + "column": 4, + "endLine": 76, + "endColumn": 23, + "path": "oauth\\tests.py", + "symbol": "inconsistent-return-statements", + "message": "Either all return statements in a function should return an expression, or none of them should.", + "message-id": "R1710" + }, + { + "type": "warning", + "module": "oauth.tests", + "obj": "OauthLoginTest.test_weibo_login", + "line": 91, + "column": 8, + "endLine": 91, + "endColumn": 11, + "path": "oauth\\tests.py", + "symbol": "unused-variable", + "message": "Unused variable 'url'", + "message-id": "W0612" + }, + { + "type": "warning", + "module": "oauth.tests", + "obj": "OauthLoginTest.test_google_login", + "line": 118, + "column": 8, + "endLine": 118, + "endColumn": 11, + "path": "oauth\\tests.py", + "symbol": "unused-variable", + "message": "Unused variable 'url'", + "message-id": "W0612" + }, + { + "type": "warning", + "module": "oauth.tests", + "obj": "OauthLoginTest.test_google_login", + "line": 133, + "column": 8, + "endLine": 133, + "endColumn": 13, + "path": "oauth\\tests.py", + "symbol": "unused-variable", + "message": "Unused variable 'token'", + "message-id": "W0612" + }, + { + "type": "warning", + "module": "oauth.tests", + "obj": "OauthLoginTest.test_github_login", + "line": 161, + "column": 8, + "endLine": 161, + "endColumn": 13, + "path": "oauth\\tests.py", + "symbol": "unused-variable", + "message": "Unused variable 'token'", + "message-id": "W0612" + }, + { + "type": "warning", + "module": "oauth.tests", + "obj": "OauthLoginTest.test_facebook_login", + "line": 194, + "column": 8, + "endLine": 194, + "endColumn": 13, + "path": "oauth\\tests.py", + "symbol": "unused-variable", + "message": "Unused variable 'token'", + "message-id": "W0612" + }, + { + "type": "warning", + "module": "oauth.tests", + "obj": "OauthLoginTest.test_qq_login", + "line": 208, + "column": 28, + "endLine": 208, + "endColumn": 39, + "path": "oauth\\tests.py", + "symbol": "unused-argument", + "message": "Unused argument 'mock_do_get'", + "message-id": "W0613" + }, + { + "type": "warning", + "module": "oauth.tests", + "obj": "OauthLoginTest.test_qq_login", + "line": 219, + "column": 8, + "endLine": 219, + "endColumn": 13, + "path": "oauth\\tests.py", + "symbol": "unused-variable", + "message": "Unused variable 'token'", + "message-id": "W0612" + }, + { + "type": "convention", + "module": "oauth.tests", + "obj": "OauthLoginTest.test_weibo_authoriz_login_without_email", + "line": 324, + "column": 8, + "endLine": 324, + "endColumn": 42, + "path": "oauth\\tests.py", + "symbol": "import-outside-toplevel", + "message": "Import outside toplevel (oauth.models.OAuthUser)", + "message-id": "C0415" + }, + { + "type": "error", + "module": "oauth.tests", + "obj": "OauthLoginTest.test_weibo_authoriz_login_without_email", + "line": 325, + "column": 21, + "endLine": 325, + "endColumn": 38, + "path": "oauth\\tests.py", + "symbol": "no-member", + "message": "Class 'OAuthUser' has no 'objects' member", + "message-id": "E1101" + }, + { + "type": "convention", + "module": "oauth.urls", + "obj": "", + "line": 54, + "column": 0, + "endLine": null, + "endColumn": null, + "path": "oauth\\urls.py", + "symbol": "trailing-newlines", + "message": "Trailing newlines", + "message-id": "C0305" + }, + { + "type": "convention", + "module": "oauth.urls", + "obj": "", + "line": 11, + "column": 0, + "endLine": 11, + "endColumn": 8, + "path": "oauth\\urls.py", + "symbol": "invalid-name", + "message": "Constant name \"app_name\" doesn't conform to UPPER_CASE naming style", + "message-id": "C0103" + }, + { + "type": "convention", + "module": "oauth.views", + "obj": "", + "line": 251, + "column": 0, + "endLine": null, + "endColumn": null, + "path": "oauth\\views.py", + "symbol": "line-too-long", + "message": "Line too long (116/100)", + "message-id": "C0301" + }, + { + "type": "convention", + "module": "oauth.views", + "obj": "", + "line": 364, + "column": 0, + "endLine": null, + "endColumn": null, + "path": "oauth\\views.py", + "symbol": "line-too-long", + "message": "Line too long (109/100)", + "message-id": "C0301" + }, + { + "type": "convention", + "module": "oauth.views", + "obj": "", + "line": 365, + "column": 0, + "endLine": null, + "endColumn": null, + "path": "oauth\\views.py", + "symbol": "line-too-long", + "message": "Line too long (122/100)", + "message-id": "C0301" + }, + { + "type": "convention", + "module": "oauth.views", + "obj": "", + "line": 372, + "column": 0, + "endLine": null, + "endColumn": null, + "path": "oauth\\views.py", + "symbol": "trailing-newlines", + "message": "Trailing newlines", + "message-id": "C0305" + }, + { + "type": "warning", + "module": "oauth.views", + "obj": "get_redirecturl", + "line": 54, + "column": 12, + "endLine": 54, + "endColumn": 47, + "path": "oauth\\views.py", + "symbol": "logging-not-lazy", + "message": "Use lazy % formatting in logging functions", + "message-id": "W1201" + }, + { + "type": "warning", + "module": "oauth.views", + "obj": "oauthlogin", + "line": 70, + "column": 4, + "endLine": 70, + "endColumn": 8, + "path": "oauth\\views.py", + "symbol": "redefined-builtin", + "message": "Redefining built-in 'type'", + "message-id": "W0622" + }, + { + "type": "warning", + "module": "oauth.views", + "obj": "authorize", + "line": 96, + "column": 4, + "endLine": 96, + "endColumn": 8, + "path": "oauth\\views.py", + "symbol": "redefined-builtin", + "message": "Redefining built-in 'type'", + "message-id": "W0622" + }, + { + "type": "warning", + "module": "oauth.views", + "obj": "authorize", + "line": 112, + "column": 11, + "endLine": 112, + "endColumn": 20, + "path": "oauth\\views.py", + "symbol": "broad-exception-caught", + "message": "Catching too general exception Exception", + "message-id": "W0718" + }, + { + "type": "warning", + "module": "oauth.views", + "obj": "authorize", + "line": 110, + "column": 8, + "endLine": 110, + "endColumn": 61, + "path": "oauth\\views.py", + "symbol": "logging-not-lazy", + "message": "Use lazy % formatting in logging functions", + "message-id": "W1201" + }, + { + "type": "error", + "module": "oauth.views", + "obj": "authorize", + "line": 130, + "column": 19, + "endLine": 130, + "endColumn": 36, + "path": "oauth\\views.py", + "symbol": "no-member", + "message": "Class 'OAuthUser' has no 'objects' member", + "message-id": "E1101" + }, + { + "type": "refactor", + "module": "oauth.views", + "obj": "authorize", + "line": 85, + "column": 0, + "endLine": 85, + "endColumn": 13, + "path": "oauth\\views.py", + "symbol": "too-many-return-statements", + "message": "Too many return statements (7/6)", + "message-id": "R0911" + }, + { + "type": "refactor", + "module": "oauth.views", + "obj": "authorize", + "line": 85, + "column": 0, + "endLine": 85, + "endColumn": 13, + "path": "oauth\\views.py", + "symbol": "too-many-branches", + "message": "Too many branches (17/12)", + "message-id": "R0912" + }, + { + "type": "refactor", + "module": "oauth.views", + "obj": "authorize", + "line": 85, + "column": 0, + "endLine": 85, + "endColumn": 13, + "path": "oauth\\views.py", + "symbol": "too-many-statements", + "message": "Too many statements (57/50)", + "message-id": "R0915" + }, + { + "type": "warning", + "module": "oauth.views", + "obj": "emailconfirm", + "line": 190, + "column": 26, + "endLine": 190, + "endColumn": 28, + "path": "oauth\\views.py", + "symbol": "redefined-builtin", + "message": "Redefining built-in 'id'", + "message-id": "W0622" + }, + { + "type": "refactor", + "module": "oauth.views", + "obj": "RequireEmailView.get", + "line": 279, + "column": 15, + "endLine": 279, + "endColumn": 44, + "path": "oauth\\views.py", + "symbol": "super-with-arguments", + "message": "Consider using Python 3 style super() without arguments", + "message-id": "R1725" + }, + { + "type": "refactor", + "module": "oauth.views", + "obj": "RequireEmailView.get_context_data", + "line": 295, + "column": 15, + "endLine": 295, + "endColumn": 44, + "path": "oauth\\views.py", + "symbol": "super-with-arguments", + "message": "Consider using Python 3 style super() without arguments", + "message-id": "R1725" + }, + { + "type": "convention", + "module": "oauth.views", + "obj": "RequireEmailView.form_valid", + "line": 317, + "column": 14, + "endLine": 317, + "endColumn": 35, + "path": "oauth\\views.py", + "symbol": "consider-using-f-string", + "message": "Formatting a regular string which could be an f-string", + "message-id": "C0209" + }, + { + "type": "warning", + "module": "oauth.views", + "obj": "bindsuccess", + "line": 352, + "column": 4, + "endLine": 352, + "endColumn": 8, + "path": "oauth\\views.py", + "symbol": "redefined-builtin", + "message": "Redefining built-in 'type'", + "message-id": "W0622" + }, + { + "type": "convention", + "module": "oauth.views", + "obj": "bindsuccess", + "line": 364, + "column": 12, + "endLine": 365, + "endColumn": 118, + "path": "oauth\\views.py", + "symbol": "consider-using-f-string", + "message": "Formatting a regular string which could be an f-string", + "message-id": "C0209" + }, + { + "type": "convention", + "module": "oauth.migrations.0001_initial", + "obj": "", + "line": 21, + "column": 0, + "endLine": null, + "endColumn": null, + "path": "oauth\\migrations\\0001_initial.py", + "symbol": "line-too-long", + "message": "Line too long (117/100)", + "message-id": "C0301" + }, + { + "type": "convention", + "module": "oauth.migrations.0001_initial", + "obj": "", + "line": 22, + "column": 0, + "endLine": null, + "endColumn": null, + "path": "oauth\\migrations\\0001_initial.py", + "symbol": "line-too-long", + "message": "Line too long (107/100)", + "message-id": "C0301" + }, + { + "type": "convention", + "module": "oauth.migrations.0001_initial", + "obj": "", + "line": 23, + "column": 0, + "endLine": null, + "endColumn": null, + "path": "oauth\\migrations\\0001_initial.py", + "symbol": "line-too-long", + "message": "Line too long (106/100)", + "message-id": "C0301" + }, + { + "type": "convention", + "module": "oauth.migrations.0001_initial", + "obj": "", + "line": 26, + "column": 0, + "endLine": null, + "endColumn": null, + "path": "oauth\\migrations\\0001_initial.py", + "symbol": "line-too-long", + "message": "Line too long (120/100)", + "message-id": "C0301" + }, + { + "type": "convention", + "module": "oauth.migrations.0001_initial", + "obj": "", + "line": 28, + "column": 0, + "endLine": null, + "endColumn": null, + "path": "oauth\\migrations\\0001_initial.py", + "symbol": "line-too-long", + "message": "Line too long (111/100)", + "message-id": "C0301" + }, + { + "type": "convention", + "module": "oauth.migrations.0001_initial", + "obj": "", + "line": 29, + "column": 0, + "endLine": null, + "endColumn": null, + "path": "oauth\\migrations\\0001_initial.py", + "symbol": "line-too-long", + "message": "Line too long (112/100)", + "message-id": "C0301" + }, + { + "type": "convention", + "module": "oauth.migrations.0001_initial", + "obj": "", + "line": 40, + "column": 0, + "endLine": null, + "endColumn": null, + "path": "oauth\\migrations\\0001_initial.py", + "symbol": "line-too-long", + "message": "Line too long (117/100)", + "message-id": "C0301" + }, + { + "type": "convention", + "module": "oauth.migrations.0001_initial", + "obj": "", + "line": 48, + "column": 0, + "endLine": null, + "endColumn": null, + "path": "oauth\\migrations\\0001_initial.py", + "symbol": "line-too-long", + "message": "Line too long (111/100)", + "message-id": "C0301" + }, + { + "type": "convention", + "module": "oauth.migrations.0001_initial", + "obj": "", + "line": 49, + "column": 0, + "endLine": null, + "endColumn": null, + "path": "oauth\\migrations\\0001_initial.py", + "symbol": "line-too-long", + "message": "Line too long (112/100)", + "message-id": "C0301" + }, + { + "type": "convention", + "module": "oauth.migrations.0001_initial", + "obj": "", + "line": 1, + "column": 0, + "endLine": null, + "endColumn": null, + "path": "oauth\\migrations\\0001_initial.py", + "symbol": "missing-module-docstring", + "message": "Missing module docstring", + "message-id": "C0114" + }, + { + "type": "convention", + "module": "oauth.migrations.0001_initial", + "obj": "", + "line": 1, + "column": 0, + "endLine": null, + "endColumn": null, + "path": "oauth\\migrations\\0001_initial.py", + "symbol": "invalid-name", + "message": "Module name \"0001_initial\" doesn't conform to snake_case naming style", + "message-id": "C0103" + }, + { + "type": "convention", + "module": "oauth.migrations.0001_initial", + "obj": "Migration", + "line": 9, + "column": 0, + "endLine": 9, + "endColumn": 15, + "path": "oauth\\migrations\\0001_initial.py", + "symbol": "missing-class-docstring", + "message": "Missing class docstring", + "message-id": "C0115" + }, + { + "type": "convention", + "module": "oauth.migrations.0002_alter_oauthconfig_options_alter_oauthuser_options_and_more", + "obj": "", + "line": 19, + "column": 0, + "endLine": null, + "endColumn": null, + "path": "oauth\\migrations\\0002_alter_oauthconfig_options_alter_oauthuser_options_and_more.py", + "symbol": "line-too-long", + "message": "Line too long (114/100)", + "message-id": "C0301" + }, + { + "type": "convention", + "module": "oauth.migrations.0002_alter_oauthconfig_options_alter_oauthuser_options_and_more", + "obj": "", + "line": 23, + "column": 0, + "endLine": null, + "endColumn": null, + "path": "oauth\\migrations\\0002_alter_oauthconfig_options_alter_oauthuser_options_and_more.py", + "symbol": "line-too-long", + "message": "Line too long (120/100)", + "message-id": "C0301" + }, + { + "type": "convention", + "module": "oauth.migrations.0002_alter_oauthconfig_options_alter_oauthuser_options_and_more", + "obj": "", + "line": 44, + "column": 0, + "endLine": null, + "endColumn": null, + "path": "oauth\\migrations\\0002_alter_oauthconfig_options_alter_oauthuser_options_and_more.py", + "symbol": "line-too-long", + "message": "Line too long (104/100)", + "message-id": "C0301" + }, + { + "type": "convention", + "module": "oauth.migrations.0002_alter_oauthconfig_options_alter_oauthuser_options_and_more", + "obj": "", + "line": 49, + "column": 0, + "endLine": null, + "endColumn": null, + "path": "oauth\\migrations\\0002_alter_oauthconfig_options_alter_oauthuser_options_and_more.py", + "symbol": "line-too-long", + "message": "Line too long (107/100)", + "message-id": "C0301" + }, + { + "type": "convention", + "module": "oauth.migrations.0002_alter_oauthconfig_options_alter_oauthuser_options_and_more", + "obj": "", + "line": 54, + "column": 0, + "endLine": null, + "endColumn": null, + "path": "oauth\\migrations\\0002_alter_oauthconfig_options_alter_oauthuser_options_and_more.py", + "symbol": "line-too-long", + "message": "Line too long (104/100)", + "message-id": "C0301" + }, + { + "type": "convention", + "module": "oauth.migrations.0002_alter_oauthconfig_options_alter_oauthuser_options_and_more", + "obj": "", + "line": 59, + "column": 0, + "endLine": null, + "endColumn": null, + "path": "oauth\\migrations\\0002_alter_oauthconfig_options_alter_oauthuser_options_and_more.py", + "symbol": "line-too-long", + "message": "Line too long (107/100)", + "message-id": "C0301" + }, + { + "type": "convention", + "module": "oauth.migrations.0002_alter_oauthconfig_options_alter_oauthuser_options_and_more", + "obj": "", + "line": 1, + "column": 0, + "endLine": null, + "endColumn": null, + "path": "oauth\\migrations\\0002_alter_oauthconfig_options_alter_oauthuser_options_and_more.py", + "symbol": "missing-module-docstring", + "message": "Missing module docstring", + "message-id": "C0114" + }, + { + "type": "convention", + "module": "oauth.migrations.0002_alter_oauthconfig_options_alter_oauthuser_options_and_more", + "obj": "", + "line": 1, + "column": 0, + "endLine": null, + "endColumn": null, + "path": "oauth\\migrations\\0002_alter_oauthconfig_options_alter_oauthuser_options_and_more.py", + "symbol": "invalid-name", + "message": "Module name \"0002_alter_oauthconfig_options_alter_oauthuser_options_and_more\" doesn't conform to snake_case naming style", + "message-id": "C0103" + }, + { + "type": "convention", + "module": "oauth.migrations.0002_alter_oauthconfig_options_alter_oauthuser_options_and_more", + "obj": "Migration", + "line": 9, + "column": 0, + "endLine": 9, + "endColumn": 15, + "path": "oauth\\migrations\\0002_alter_oauthconfig_options_alter_oauthuser_options_and_more.py", + "symbol": "missing-class-docstring", + "message": "Missing class docstring", + "message-id": "C0115" + }, + { + "type": "convention", + "module": "oauth.migrations.0003_alter_oauthuser_nickname", + "obj": "", + "line": 1, + "column": 0, + "endLine": null, + "endColumn": null, + "path": "oauth\\migrations\\0003_alter_oauthuser_nickname.py", + "symbol": "missing-module-docstring", + "message": "Missing module docstring", + "message-id": "C0114" + }, + { + "type": "convention", + "module": "oauth.migrations.0003_alter_oauthuser_nickname", + "obj": "", + "line": 1, + "column": 0, + "endLine": null, + "endColumn": null, + "path": "oauth\\migrations\\0003_alter_oauthuser_nickname.py", + "symbol": "invalid-name", + "message": "Module name \"0003_alter_oauthuser_nickname\" doesn't conform to snake_case naming style", + "message-id": "C0103" + }, + { + "type": "convention", + "module": "oauth.migrations.0003_alter_oauthuser_nickname", + "obj": "Migration", + "line": 6, + "column": 0, + "endLine": 6, + "endColumn": 15, + "path": "oauth\\migrations\\0003_alter_oauthuser_nickname.py", + "symbol": "missing-class-docstring", + "message": "Missing class docstring", + "message-id": "C0115" + }, + { + "type": "convention", + "module": "oauth.templatetags.oauth_tags", + "obj": "", + "line": 1, + "column": 0, + "endLine": null, + "endColumn": null, + "path": "oauth\\templatetags\\oauth_tags.py", + "symbol": "missing-module-docstring", + "message": "Missing module docstring", + "message-id": "C0114" + }, + { + "type": "convention", + "module": "oauth.templatetags.oauth_tags", + "obj": "load_oauth_applications", + "line": 10, + "column": 0, + "endLine": 10, + "endColumn": 27, + "path": "oauth\\templatetags\\oauth_tags.py", + "symbol": "missing-function-docstring", + "message": "Missing function or method docstring", + "message-id": "C0116" + }, + { + "type": "convention", + "module": "oauth.templatetags.oauth_tags", + "obj": "load_oauth_applications.Congratulations, you have successfully bound your email address. You can use @@ -259,7 +259,7 @@ def emailconfirm(request, id, sign): class RequireEmailView(FormView): - """ + """lrj: 要求邮箱表单视图 处理用户补充邮箱信息的流程 """ @@ -267,19 +267,19 @@ class RequireEmailView(FormView): template_name = 'oauth/require_email.html' def get(self, request, *args, **kwargs): - """GET请求处理""" + """lrj:GET请求处理""" oauthid = self.kwargs['oauthid'] oauthuser = get_object_or_404(OAuthUser, pk=oauthid) - # 如果已有邮箱,可能直接跳转(当前注释掉了) + # lrj:如果已有邮箱,可能直接跳转(当前注释掉了) if oauthuser.email: pass - # return HttpResponseRedirect('/') + # lrj:return HttpResponseRedirect('/') return super(RequireEmailView, self).get(request, *args, **kwargs) def get_initial(self): - """设置表单初始值""" + """lrj:设置表单初始值""" oauthid = self.kwargs['oauthid'] return { 'email': '', @@ -287,7 +287,7 @@ class RequireEmailView(FormView): } def get_context_data(self, **kwargs): - """添加上下文数据""" + """lrj:添加上下文数据""" oauthid = self.kwargs['oauthid'] oauthuser = get_object_or_404(OAuthUser, pk=oauthid) if oauthuser.picture: @@ -295,18 +295,18 @@ class RequireEmailView(FormView): return super(RequireEmailView, self).get_context_data(**kwargs) def form_valid(self, form): - """表单验证通过后的处理""" + """lrj:表单验证通过后的处理""" email = form.cleaned_data['email'] oauthid = form.cleaned_data['oauthid'] oauthuser = get_object_or_404(OAuthUser, pk=oauthid) oauthuser.email = email oauthuser.save() - # 生成安全签名 + # lrj:生成安全签名 sign = get_sha256(settings.SECRET_KEY + str(oauthuser.id) + settings.SECRET_KEY) - # 构建确认链接 + # lrj:构建确认链接 site = get_current_site().domain if settings.DEBUG: site = '127.0.0.1:8000' @@ -316,7 +316,7 @@ class RequireEmailView(FormView): }) url = "http://{site}{path}".format(site=site, path=path) - # 发送确认邮件 + # lrj:发送确认邮件 content = _("""
Please click the link below to bind your email
@@ -330,7 +330,7 @@ class RequireEmailView(FormView): """) % {'url': url} send_email(emailto=[email, ], title=_('Bind your email'), content=content) - # 跳转到绑定成功提示页面 + # lrj:跳转到绑定成功提示页面 url = reverse('oauth:bindsuccess', kwargs={ 'oauthid': oauthid }) @@ -339,7 +339,7 @@ class RequireEmailView(FormView): def bindsuccess(request, oauthid): - """ + """lrj: 绑定成功提示页面 Args: @@ -352,7 +352,7 @@ def bindsuccess(request, oauthid): type = request.GET.get('type', None) oauthuser = get_object_or_404(OAuthUser, pk=oauthid) - # 根据绑定类型显示不同内容 + #lrj: 根据绑定类型显示不同内容 if type == 'email': title = _('Bind your email') content = _(