Skip to content

Commit

Permalink
black format
Browse files Browse the repository at this point in the history
  • Loading branch information
vokimon committed Apr 13, 2022
1 parent f1e449c commit 45d23e2
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions heman/auth/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,11 @@ def check_contract_allowed(func):
@wraps(func)
def decorator(*args, **kwargs):
contract = kwargs.get('contract')
if (contract and current_user.is_authenticated()
and not current_user.allowed(contract)):
if (
contract
and current_user.is_authenticated()
and not current_user.allowed(contract)
):
return current_app.login_manager.unauthorized()
return func(*args, **kwargs)
return decorator
Expand All @@ -32,8 +35,11 @@ def check_cups_allowed(func):
@wraps(func)
def decorator(*args, **kwargs):
cups = kwargs.get('cups')
if (cups and current_user.is_authenticated()
and not current_user.allowed(cups, 'cups')):
if (
cups
and current_user.is_authenticated()
and not current_user.allowed(cups, 'cups')
):
return current_app.login_manager.unauthorized()
return func(*args, **kwargs)
return decorator
Expand Down

0 comments on commit 45d23e2

Please sign in to comment.