12
113
Fork
You've already forked django-allauth
149

chore: add __repr__s to various objects #4710

Open
akx wants to merge 1 commit from akx/django-allauth:reprs into main
pull from: akx/django-allauth:reprs
merge into: allauth:main
allauth:main
allauth:fix/account-middleware-reauth-exc-vs-api
allauth:65.12.x
allauth:65.11.x
allauth:feat/openid-connect-id-token
allauth:fix/phone-vs-social-signup
allauth:65.8.x
allauth:feat/idp
allauth:feat/resend-code-or-change
allauth:fix/phone-signup-conflict
allauth:feat/phone
allauth:fix/headless-email-verification-by-code
allauth:fix/a11y
allauth:feat/facebook-limited-login
allauth:fix/headless-only-connect-reauth
allauth:fix/email-added-vs-code-verification
allauth:feat/login-required-middleware
allauth:0.63.x
allauth:refactor-unique-true-field
allauth:0.62.x
allauth:0.57.x
allauth:0.60.x
allauth:0.55.x
allauth:feat-metamask
Contributor
Copy link

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?

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 `repr`ing what could be sensitive data, so the reprs aren't as useful as they maybe totally could?
chore: add __repr__s to various objects
Some checks are pending
ci/woodpecker/pr/woodpecker/1 Pipeline is pending approval
ci/woodpecker/pr/woodpecker/2 Pipeline is pending approval
e0d90206b3
@ -197,2 +197,4 @@
self.email_address = email_address
def __repr__(self) -> str:
return f"EmailConfirmationHMAC(email_address={self.email_address!r})"
Owner
Copy link

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.

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},"
Owner
Copy link

Similar PII concern as above.

Similar PII concern as above.
@ -34,2 +34,4 @@
)
def __repr__(self) -> str:
return f"{self.__class__.__name__}(key={self.key!r})"
Owner
Copy link

This seems inconsistent, here the class name is used, above the name is hardcoded. Shouldn't hardcoding be avoided?

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)
Owner
Copy link

Why use getattr?

Why use `getattr`?
Some checks are pending
ci/woodpecker/pr/woodpecker/1 Pipeline is pending approval
ci/woodpecker/pr/woodpecker/2 Pipeline is pending approval
This pull request has changes conflicting with the target branch.
  • allauth/socialaccount/models.py
  • allauth/socialaccount/sessions.py
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u reprs:akx-reprs
git switch akx-reprs

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff akx-reprs
git switch akx-reprs
git rebase main
git switch main
git merge --ff-only akx-reprs
git switch akx-reprs
git rebase main
git switch main
git merge --no-ff akx-reprs
git switch main
git merge --squash akx-reprs
git switch main
git merge --ff-only akx-reprs
git switch main
git merge akx-reprs
git push origin main
Sign in to join this conversation.
No reviewers
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
allauth/django-allauth!4710
Reference in a new issue
allauth/django-allauth
No description provided.
Delete branch "akx/django-allauth:reprs"

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?