Last active
September 20, 2023 08:48
-
-
Save dkhmelenko/9278ea70fc66890a0654fcbd10a6931c to your computer and use it in GitHub Desktop.
Decorator with arguments
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def authenticate(request): | |
def decorator(*args, **kwargs): | |
add_auth_headers() | |
request(*args, **kwargs) | |
def add_auth_headers(): | |
... | |
return decorator | |
@authenticate | |
def get_employees(user): | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment