diff options
| author | Nejc Habjan <nejc.habjan@siemens.com> | 2022-08-10 14:24:06 +0200 |
|---|---|---|
| committer | Nejc Habjan <nejc.habjan@siemens.com> | 2022-08-10 14:24:06 +0200 |
| commit | a07547cba981380935966dff2c87c2c27d6b18d9 (patch) | |
| tree | 98182007107a6cf4ced8fb53d34911b1aba35bb3 /gitlab | |
| parent | 181390a4e07e3c62b86ade11d9815d36440f5817 (diff) | |
| download | gitlab-a07547cba981380935966dff2c87c2c27d6b18d9.tar.gz | |
fix(client): do not assume user attrs returned for auth()
This is mostly relevant for people mocking the API in tests.
Diffstat (limited to 'gitlab')
| -rw-r--r-- | gitlab/client.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/gitlab/client.py b/gitlab/client.py index 2faca69..1c61e5e 100644 --- a/gitlab/client.py +++ b/gitlab/client.py @@ -355,7 +355,9 @@ class Gitlab: success. """ self.user = self._objects.CurrentUserManager(self).get() - self._check_url(self.user.web_url, path=self.user.username) + + if hasattr(self.user, "web_url") and hasattr(self.user, "username"): + self._check_url(self.user.web_url, path=self.user.username) def version(self) -> Tuple[str, str]: """Returns the version and revision of the gitlab server. |
