8000 cleanup @requires_auth decorator · omgjlk/github3.py@0168f13 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0168f13

Browse files
author
Eugene Eeo
committed
cleanup @requires_auth decorator
1 parent 74c4c53 commit 0168f13

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

github3/decorators.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,7 @@ def requires_auth(func):
2929
"""Decorator to note which object methods require authorization."""
3030
@wraps(func)
3131
def auth_wrapper(self, *args, **kwargs):
32-
auth = False
33-
if hasattr(self, 'session'):
34-
auth = self.session.has_auth()
35-
36-
if auth:
32+
if hasattr(self, 'session') and self.session.has_auth():
3733
return func(self, *args, **kwargs)
3834
else:
3935
from .exceptions import error_for

0 commit comments

Comments
 (0)
0