|
|
|
@ -66,7 +66,7 @@ class UserSchema(BaseTildesSchema): |
|
|
|
def anonymize_username(self, data: dict, many: bool) -> dict: |
|
|
|
"""Hide the username if the dumping context specifies to do so.""" |
|
|
|
# pylint: disable=unused-argument |
|
|
|
if not TildesSchemaContext.get(default=self.context).get("hide_username"): |
|
|
|
if not self.get_context_value("hide_username"): |
|
|
|
return data |
|
|
|
|
|
|
|
if "username" not in data: |
|
|
|
@ -105,9 +105,7 @@ class UserSchema(BaseTildesSchema): |
|
|
|
Requires check_breached_passwords be True in the schema's context. |
|
|
|
""" |
|
|
|
# pylint: disable=unused-argument |
|
|
|
if not TildesSchemaContext.get(default=self.context).get( |
|
|
|
"check_breached_passwords" |
|
|
|
): |
|
|
|
if not self.get_context_value("check_breached_passwords"): |
|
|
|
return |
|
|
|
|
|
|
|
if is_breached_password(value): |
|
|
|
@ -125,9 +123,7 @@ class UserSchema(BaseTildesSchema): |
|
|
|
Requires username_trim_whitespace be True in the schema's context. |
|
|
|
""" |
|
|
|
# pylint: disable=unused-argument |
|
|
|
if not TildesSchemaContext.get(default=self.context).get( |
|
|
|
"username_trim_whitespace" |
|
|
|
): |
|
|
|
if not self.get_context_value("username_trim_whitespace"): |
|
|
|
return data |
|
|
|
|
|
|
|
if "username" not in data: |
|
|
|
|