Skip to content
This repository has been archived by the owner on Jan 22, 2022. It is now read-only.

Black Formatting Changes #371

Merged
merged 1 commit into from May 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion code/src/web-server/oauth_client.py
Expand Up @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion common/oauth_client.py
Expand Up @@ -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))
Expand Down
14 changes: 7 additions & 7 deletions common/rpc/auth_utils.py
Expand Up @@ -40,7 +40,7 @@ class OKException(Exception):


class OAuthException(OKException):
""" OAuth related exception """
"""OAuth related exception"""

def __init__(self, error="", error_description=""):
super().__init__()
Expand All @@ -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)
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -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())
Expand Down
2 changes: 1 addition & 1 deletion oh/oh_queue/models.py
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion oh/oh_queue/views.py
Expand Up @@ -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
)
Expand Down