diff --git a/code/src/web-server/oauth_client.py b/code/src/web-server/oauth_client.py index 85cae26f..7540f176 100644 --- a/code/src/web-server/oauth_client.py +++ b/code/src/web-server/oauth_client.py @@ -48,7 +48,7 @@ def kill_popup(): return response def check_req(uri, headers, body): - """ Add access_token to the URL Request. """ + """Add access_token to the URL Request.""" if "access_token" not in uri and session.get("dev_token"): params = {"access_token": session.get("dev_token")[0]} url_parts = list(urllib.parse.urlparse(uri)) diff --git a/common/oauth_client.py b/common/oauth_client.py index 0be64042..fd464715 100644 --- a/common/oauth_client.py +++ b/common/oauth_client.py @@ -147,7 +147,7 @@ def create_oauth_client( ) def check_req(uri, headers, body): - """ Add access_token to the URL Request. """ + """Add access_token to the URL Request.""" if "access_token" not in uri and session.get("access_token"): params = {"access_token": session.get("access_token")[0]} url_parts = list(urllib.parse.urlparse(uri)) diff --git a/common/rpc/auth_utils.py b/common/rpc/auth_utils.py index a94e3b5b..bcbc5807 100644 --- a/common/rpc/auth_utils.py +++ b/common/rpc/auth_utils.py @@ -40,7 +40,7 @@ class OKException(Exception): class OAuthException(OKException): - """ OAuth related exception """ + """OAuth related exception""" def __init__(self, error="", error_description=""): super().__init__() @@ -49,7 +49,7 @@ def __init__(self, error="", error_description=""): def _pick_free_port(hostname=REDIRECT_HOST, port=0): - """ Try to bind a port. Default=0 selects a free port. """ + """Try to bind a port. Default=0 selects a free port.""" import socket s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) @@ -109,7 +109,7 @@ def _make_refresh_post(server, refresh_token): def _get_code(no_browser): - """ Make the requests to get OK access code """ + """Make the requests to get OK access code""" host_name = REDIRECT_HOST try: @@ -203,10 +203,10 @@ def log_message(self, format, *args): class OAuthSession: - """ Represents OK OAuth state """ + """Represents OK OAuth state""" def __init__(self, access_token="", refresh_token="", expires_at=-1, session=None): - """ Create OK OAuth state with given tokens, and expiration """ + """Create OK OAuth state with given tokens, and expiration""" self.session = self.refresh_token = self.access_token = None self.expires_at = -1 self.assignment = None @@ -227,7 +227,7 @@ def __init__(self, access_token="", refresh_token="", expires_at=-1, session=Non self.expires_at = expires_at def _dump(self): - """ Dump state to a Bacon session """ + """Dump state to a Bacon session""" if self.session is not None: config = self.session.config() if self.access_token: @@ -240,7 +240,7 @@ def _dump(self): config["ok_last_download_assignment"] = self.assignment def refresh(self): - """ Refreshes a token """ + """Refreshes a token""" if not self.refresh_token: return False cur_time = int(time.time()) diff --git a/oh/oh_queue/models.py b/oh/oh_queue/models.py index 41e8947d..5b928596 100755 --- a/oh/oh_queue/models.py +++ b/oh/oh_queue/models.py @@ -12,7 +12,7 @@ class EnumType(db.TypeDecorator): impl = db.String(255) def __repr__(self): - """ Make alembic detect the right type """ + """Make alembic detect the right type""" return "db.String(length=255)" def __init__(self, enum_class): diff --git a/oh/oh_queue/views.py b/oh/oh_queue/views.py index 702d9ebf..8bc1864e 100755 --- a/oh/oh_queue/views.py +++ b/oh/oh_queue/views.py @@ -58,7 +58,7 @@ def user_json(user): def student_json(user): - """ Only send student information to staff. """ + """Only send student information to staff.""" can_see_details = current_user.is_authenticated and ( current_user.is_staff or user.id == current_user.id )