Fix require_login

This commit is contained in:
Sijmen 2018-08-17 16:27:26 +02:00
parent 5d955608f6
commit b098ab1d5c

View file

@ -1,4 +1,3 @@
import commands.login
import shutil
import textwrap
from typing import Any, Callable
@ -27,7 +26,7 @@ def print_wrap(text: str, indent: str = '', end: str = '\n') -> None:
def require_login(function: Callable) -> Callable:
def wrapper(*args: Any, **kwargs: Any) -> Any:
while 'api_token' not in Config['user']:
commands.login.login(None)
print('Not logged in. Please use the login command to log in.')
return function(*args, **kwargs)