This PR adds __repr__ implementations to various objects missing them, so e.g. logging them makes more sense.
I tried to be diligent about not repring what could be sensitive data, so the reprs aren't as useful as they maybe totally could?
akx/django-allauth:reprs into main
This PR adds __repr__ implementations to various objects missing them, so e.g. logging them makes more sense.
I tried to be diligent about not repring what could be sensitive data, so the reprs aren't as useful as they maybe totally could?
@ -197,2 +197,4 @@
self.email_address = email_address
def __repr__(self) -> str:
return f"EmailConfirmationHMAC(email_address={self.email_address!r})"
Do we really need this? One concern is that the email address is PII, and by adding this repr the email address may end up inexpectedly in logs etc.
@ -283,1 +286,4 @@
def __repr__(self) -> str:
return (
f"Login(user={self.user!r}, email={self.email!r},"
Similar PII concern as above.
@ -34,2 +34,4 @@
)
def __repr__(self) -> str:
return f"{self.__class__.__name__}(key={self.key!r})"
This seems inconsistent, here the class name is used, above the name is hardcoded. Shouldn't hardcoding be avoided?
@ -236,2 +236,4 @@
self.phone_verified = phone_verified
def __repr__(self) -> str:
provider = getattr(self, "provider", None)
Why use getattr?
Use this merge commit message when completing the merge manually.
Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.
No due date set.
No dependencies set.
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?