MCPcopy Create free account
hub / github.com/TimMcCool/scratchattach / connect_linked_user

Method connect_linked_user

scratchattach/site/session.py:224–241  ·  view source on GitHub ↗

Gets the user associated with the login / session. Warning: The returned User object is cached. To ensure its attribute are up to date, you need to run .update() on it. Returns: scratchattach.user.User: Object representing the user associated with t

(self)

Source from the content-addressed store, hash-verified

222 self.ocular_token = token
223
224 def connect_linked_user(self) -> user.User:
225 """
226 Gets the user associated with the login / session.
227
228 Warning:
229 The returned User object is cached. To ensure its attribute are up to date, you need to run .update() on it.
230
231 Returns:
232 scratchattach.user.User: Object representing the user associated with the session.
233 """
234 cached = hasattr(self, "_user")
235 if cached:
236 cached = self._user is not None
237
238 if not cached:
239 self._user = self.connect_user(self._username)
240 assert self._user is not None
241 return self._user
242
243 def get_linked_user(self) -> user.User:
244 # backwards compatibility with v1

Callers 4

__rich__Method · 0.95
get_linked_userMethod · 0.95
profileFunction · 0.80
test_commentFunction · 0.80

Calls 1

connect_userMethod · 0.95

Tested by 1

test_commentFunction · 0.64