8000 Merge pull request #365 from eugene-eeo/develop · zubchick/github3.py@a1640d4 · GitHub
[go: up one dir, main page]

Skip to content

Commit a1640d4

Browse files
committed
Merge pull request sigmavirus24#365 from eugene-eeo/develop
Cleanup @requires_auth decorator
2 parents 74c4c53 + 0168f13 commit a1640d4

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