Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore usernames to user model #211

Merged
merged 1 commit into from
Jul 23, 2024
Merged

Conversation

fsargent
Copy link
Contributor

No description provided.

Copy link

coderabbitai bot commented Jul 23, 2024

Walkthrough

This update streamlines the user account management in the application by introducing a custom signup form, making usernames mandatory, and enhancing the login and signup templates with modern designs. The changes improve user experience through a more organized layout and flexible authentication options, aligning the interface with contemporary standards.

Changes

File Path Change Summary
approval_polls/forms.py Introduced CustomSignupForm, removing the password confirmation field and modifying the save method for user creation.
approval_polls/settings.py Updated user account settings to require usernames, expanded authentication methods, and specified the custom signup form.
approval_polls/templates/account/*.html Revised base_manage.html to extend a new layout, improved login.html with a card design and Google sign-in option, and updated signup.html for better structuring and user interface.

Poem

🐰 In fields of code where bunnies play,
A signup form was born today!
With usernames now in the mix,
The login sparkles with new tricks.
Hooray for change, let joy abound,
In a world of forms, we’re hopping around! 🎉✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @fsargent and the rest of your teammates on Graphite Graphite

@fsargent fsargent marked this pull request as ready for review July 23, 2024 23:10
Copy link
Contributor

sourcery-ai bot commented Jul 23, 2024

🧙 Sourcery has finished reviewing your pull request!


Tips
  • Trigger a new Sourcery review by commenting @sourcery-ai review on the pull request.
  • Continue your discussion with Sourcery by replying directly to review comments.
  • You can change your review settings at any time by accessing your dashboard:
    • Enable or disable the Sourcery-generated pull request summary or reviewer's guide;
    • Change the review language;
  • You can always contact us if you have any questions or feedback.

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We've reviewed this pull request using the Sourcery rules engine. If you would also like our AI-powered code review then let us know.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 3b22b21 and fd443e7.

Files selected for processing (5)
  • approval_polls/forms.py (2 hunks)
  • approval_polls/settings.py (2 hunks)
  • approval_polls/templates/account/base_manage.html (1 hunks)
  • approval_polls/templates/account/login.html (1 hunks)
  • approval_polls/templates/account/signup.html (1 hunks)
Additional comments not posted (15)
approval_polls/templates/account/base_manage.html (1)

1-1: Verify the appropriateness of the new base template.

The template now extends ../base.html instead of allauth/layouts/manage.html. Ensure that ../base.html provides the necessary structure and styles for managing accounts.

approval_polls/templates/account/signup.html (5)

Line range hint 1-5:
Verify the appropriateness of the base template and loaded libraries.

The template extends base.html and loads necessary libraries (widget_tweaks, allauth, i18n). Ensure that these are appropriate for the signup page.


6-6: LGTM!

The head title is set to "Sign Up" and is correctly localized.


9-50: LGTM! But verify the Bootstrap layout.

The content uses Bootstrap's grid system and card layout. Ensure that the layout is appropriate and correctly implemented.


19-35: LGTM! But verify form field handling.

The form uses a loop to iterate through form fields and handles errors appropriately. Ensure that the form is correctly implemented.


Line range hint 37-56:
LGTM!

The actions and social login options are correctly implemented.

approval_polls/templates/account/login.html (3)

Line range hint 1-10:
Verify the appropriateness of the base template and loaded libraries.

The template extends base.html and loads necessary libraries (static, socialaccount, i18n, allauth account, widget_tweaks). Ensure that these are appropriate for the login page.


11-11: LGTM!

The head title is set to "Sign In" and is correctly localized.


11-56: LGTM! But verify the Bootstrap layout.

The content uses Bootstrap's grid system and card layout. Ensure that the layout is appropriate and correctly implemented.

approval_polls/forms.py (2)

95-99: Ensure proper handling of password confirmation removal.

The __init__ method removes the password2 field, which is typically used for password confirmation. Ensure that this change is intentional and that the user experience and security implications are considered.


100-103: LGTM!

The save method correctly overrides the default behavior and ensures the user is saved without using the password2 field.

approval_polls/settings.py (4)

261-261: Ensure the username field is correctly integrated.

The ACCOUNT_USER_MODEL_USERNAME_FIELD is set to "username". Verify that the user model includes this field and that it is correctly integrated throughout the application.


262-262: Mandatory username requirement.

The ACCOUNT_USERNAME_REQUIRED is set to True, making usernames mandatory. Ensure that all user creation processes and forms are updated to reflect this requirement.


267-267: Expanded authentication methods.

The ACCOUNT_AUTHENTICATION_METHOD is updated to "username_email", allowing users to authenticate using either their username or email. Ensure that this change is reflected in the login forms and authentication logic.


276-276: Custom signup form integration.

The ACCOUNT_FORMS setting specifies a custom signup form: {"signup": "approval_polls.forms.CustomSignupForm"}. Verify that the custom form is correctly integrated and functioning as expected.

@fsargent fsargent merged commit 97209e0 into main Jul 23, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant