Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit a07547c

Browse filesBrowse files
committed
fix(client): do not assume user attrs returned for auth()
This is mostly relevant for people mocking the API in tests.
1 parent 181390a commit a07547c
Copy full SHA for a07547c

File tree

Expand file treeCollapse file tree

1 file changed

+3
-1
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-1
lines changed
Open diff view settings
Collapse file

‎gitlab/client.py‎

Copy file name to clipboardExpand all lines: gitlab/client.py
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,9 @@ def auth(self) -> None:
355355
success.
356356
"""
357357
self.user = self._objects.CurrentUserManager(self).get()
358-
self._check_url(self.user.web_url, path=self.user.username)
358+
359+
if hasattr(self.user, "web_url") and hasattr(self.user, "username"):
360+
self._check_url(self.user.web_url, path=self.user.username)
359361

360362
def version(self) -> Tuple[str, str]:
361363
"""Returns the version and revision of the gitlab server.

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.