Remove optional, now is not optional

This commit is contained in:
Matthias 2020-10-27 10:08:24 +01:00
parent 5c8779b155
commit 72f61f4682

View File

@ -684,15 +684,12 @@ class PairLock(_DECL_BASE):
f'lock_end_time={lock_end_time})')
@staticmethod
def query_pair_locks(pair: Optional[str], now: Optional[datetime] = None) -> Query:
def query_pair_locks(pair: Optional[str], now: datetime) -> Query:
"""
Get all locks for this pair
:param pair: Pair to check for. Returns all current locks if pair is empty
:param now: Datetime object (generated via datetime.now(timezone.utc)).
defaults to datetime.utcnow()
"""
if not now:
now = datetime.now(timezone.utc)
filters = [PairLock.lock_end_time > now,
# Only active locks