Fix require_login

This commit is contained in:
Sijmen 2018-08-17 16:27:26 +02:00
parent 5d955608f6
commit b098ab1d5c
1 changed files with 1 additions and 2 deletions

View File

@ -1,4 +1,3 @@
import commands.login
import shutil import shutil
import textwrap import textwrap
from typing import Any, Callable 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 require_login(function: Callable) -> Callable:
def wrapper(*args: Any, **kwargs: Any) -> Any: def wrapper(*args: Any, **kwargs: Any) -> Any:
while 'api_token' not in Config['user']: 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) return function(*args, **kwargs)