Skip to content

Commit 0b2e227

Browse files
committed
add type hints
1 parent 3a5f547 commit 0b2e227

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/sentry/models/apitoken.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -138,11 +138,11 @@ def _set_plaintext_token(self, token: str) -> None:
138138
:param token: A plaintext string of the token
139139
:raises PlaintextSecretAlreadyRead: when the token has already been read once
140140
"""
141-
existing_token = None
141+
existing_token: str | None = None
142142
try:
143-
existing_token = self.__plaintext_token # type: ignore[has-type]
143+
existing_token = self.__plaintext_token
144144
except AttributeError:
145-
self.__plaintext_token = token
145+
self.__plaintext_token: str = token
146146

147147
if existing_token == TOKEN_REDACTED:
148148
raise PlaintextSecretAlreadyRead()
@@ -155,11 +155,11 @@ def _set_plaintext_refresh_token(self, token: str) -> None:
155155
:param token: A plaintext string of the refresh token
156156
:raises PlaintextSecretAlreadyRead: if the token has already been read once
157157
"""
158-
existing_refresh_token = None
158+
existing_refresh_token: str | None = None
159159
try:
160-
existing_refresh_token = self.__plaintext_refresh_token # type: ignore[has-type]
160+
existing_refresh_token = self.__plaintext_refresh_token
161161
except AttributeError:
162-
self.__plaintext_refresh_token = token
162+
self.__plaintext_refresh_token: str = token
163163

164164
if existing_refresh_token == TOKEN_REDACTED:
165165
raise PlaintextSecretAlreadyRead()

0 commit comments

Comments
 (0)