Skip to content
This repository was archived by the owner on Aug 30, 2023. It is now read-only.

Commit 8a11333

Browse files
author
Joshua Li
committed
fix lint errors
1 parent 3545688 commit 8a11333

File tree

6 files changed

+12
-13
lines changed

6 files changed

+12
-13
lines changed

sentry_auth_github/client.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
from __future__ import absolute_import, print_function
1+
from __future__ import absolute_import
22

3+
import six
34
from requests.exceptions import RequestException
45
from sentry import http
56
from sentry.utils import json
@@ -35,7 +36,7 @@ def _request(self, path, access_token):
3536
headers=headers,
3637
)
3738
except RequestException as e:
38-
raise GitHubApiError(unicode(e), status=getattr(e, 'status_code', 0))
39+
raise GitHubApiError(six.text_type(e), status=getattr(e, 'status_code', 0))
3940
if req.status_code < 200 or req.status_code >= 300:
4041
raise GitHubApiError(req.content, status=req.status_code)
4142
return json.loads(req.content)
@@ -51,8 +52,8 @@ def get_user_emails(self, access_token):
5152

5253
def is_org_member(self, access_token, org_id):
5354
org_list = self.get_org_list(access_token)
54-
org_id = str(org_id)
55+
org_id = six.binary_type(org_id)
5556
for o in org_list:
56-
if str(o['id']) == org_id:
57+
if six.binary_type((o['id']) == org_id:
5758
return True
5859
return False

sentry_auth_github/views.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
from __future__ import absolute_import, print_function
1+
from __future__ import absolute_import
22

3+
import six
34
from django import forms
45
from sentry.auth.view import AuthView, ConfigureView
56
from sentry.models import AuthIdentity
@@ -127,7 +128,7 @@ def handle(self, request, helper):
127128
form = SelectOrganizationForm(org_list, request.POST or None)
128129
if form.is_valid():
129130
org_id = form.cleaned_data['org']
130-
org = [o for o in org_list if org_id == str(o['id'])][0]
131+
org = [o for o in org_list if org_id == six.binary_type(o['id'])][0]
131132
helper.bind_state('org', org)
132133
return helper.next_step()
133134

setup.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
#!/usr/bin/env python
2+
3+
from __future__ import absolute_import
4+
25
"""
36
sentry-auth-github
47
==================

tests/test_plugin.py

Whitespace-only changes.

tests/test_provider.py

-6
This file was deleted.

tests/test_views.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from __future__ import absolute_import, print_function
1+
from __future__ import absolute_import
22

33
import pytest
44

0 commit comments

Comments
 (0)