~sircmpwn/core.sr.ht

052965b11c05a5a78e066ca84ddc358c3235a757 — Drew DeVault 1 year, 10 months ago 5194744 0.55.4
get_authorization: fix use with LocalProxy
2 files changed, 5 insertions(+), 0 deletions(-)

M srht/api.py
M srht/scss/base.scss
M srht/api.py => srht/api.py +4 -0
@@ 1,6 1,7 @@
import requests
from flask import current_app, request
from srht.crypto import encrypt_request_authorization
from werkzeug.local import LocalProxy

_default = 1



@@ 48,6 49,9 @@ def paginated_response(id_col, query,
    }

def get_authorization(user_or_token):
    if isinstance(user_or_token, LocalProxy):
        # This can happen if current_user is passed into this function
        user_or_token = user_or_token._get_current_object()
    if isinstance(user_or_token, current_app.oauth_service.User):
        user = user_or_token
        if user.oauth_token:

M srht/scss/base.scss => srht/scss/base.scss +1 -0
@@ 50,6 50,7 @@ label {
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
textarea.form-control {
  border-radius: 0;
  border-color: #888;