mirror of
https://github.com/freqtrade/freqtrade.git
synced 2024-11-10 10:21:59 +00:00
Extract httpBasic from function header
This commit is contained in:
parent
927c54094a
commit
08f2eebd6e
|
@ -26,6 +26,7 @@ def verify_auth(api_config, username: str, password: str):
|
|||
|
||||
|
||||
httpbasic = HTTPBasic(auto_error=False)
|
||||
security = HTTPBasic()
|
||||
oauth2_scheme = OAuth2PasswordBearer(tokenUrl="token", auto_error=False)
|
||||
|
||||
|
||||
|
@ -117,7 +118,7 @@ def http_basic_or_jwt_token(form_data: HTTPBasicCredentials = Depends(httpbasic)
|
|||
|
||||
|
||||
@router_login.post('/token/login', response_model=AccessAndRefreshToken)
|
||||
def token_login(form_data: HTTPBasicCredentials = Depends(HTTPBasic()),
|
||||
def token_login(form_data: HTTPBasicCredentials = Depends(security),
|
||||
api_config=Depends(get_api_config)):
|
||||
|
||||
if verify_auth(api_config, form_data.username, form_data.password):
|
||||
|
|
|
@ -460,8 +460,10 @@ class RPC:
|
|||
|
||||
def _rpc_trade_statistics(
|
||||
self, stake_currency: str, fiat_display_currency: str,
|
||||
start_date: datetime = datetime.fromtimestamp(0)) -> Dict[str, Any]:
|
||||
start_date: Optional[datetime] = None) -> Dict[str, Any]:
|
||||
""" Returns cumulative profit statistics """
|
||||
if start_date is None:
|
||||
start_date = datetime.fromtimestamp(0)
|
||||
trade_filter = ((Trade.is_open.is_(False) & (Trade.close_date >= start_date)) |
|
||||
Trade.is_open.is_(True))
|
||||
trades: Sequence[Trade] = Trade.session.scalars(Trade.get_trades_query(
|
||||
|
|
Loading…
Reference in New Issue
Block a user