-
Notifications
You must be signed in to change notification settings - Fork 0
improve web app cq #31
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the web application to improve code quality by modularizing URL routing, migrating from Django forms to REST Framework serializers, implementing a logging sanitization filter, and pinning exact dependency versions. The changes focus on better separation of concerns and enhanced security.
- Modularized URL configuration by splitting routes into app-specific URL files
- Migrated review validation from Django forms to DRF serializers
- Added logging sanitization filter to prevent log injection attacks
Reviewed Changes
Copilot reviewed 18 out of 25 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| website/urls.py | Simplified main URL configuration by delegating to app-specific URL patterns |
| website/settings.py | Added WEB configuration for pagination and review settings |
| utils/logging.py | New sanitization filter to prevent log injection vulnerabilities |
| pyproject.toml | Pinned exact dependency versions and added missing dependencies |
| frontend | Updated frontend submodule reference |
| config.yaml.example | Added example configuration for new WEB settings |
| apps/web/views.py | Refactored views to use DRF generic views and added comprehensive logging |
| apps/web/urls.py | New app-specific URL configuration for web routes |
| apps/web/serializers.py | Added review validation logic and vote count serializer methods |
| apps/web/models/vote_for_review.py | Removed denormalized vote counts in favor of dynamic calculation |
| apps/web/models/review.py | Added methods to calculate vote counts and removed stored count fields |
| apps/web/models/forms/review_form.py | Deleted Django form in favor of serializer validation |
| apps/web/models/forms/init.py | Removed form imports |
| apps/web/migrations/0010_remove_review_dislike_count_and_more.py | Migration to remove denormalized vote count fields |
| apps/spider/urls.py | New app-specific URL configuration for spider routes |
| apps/auth/views.py | Improved logging with sanitization and consistency |
| apps/auth/utils.py | Improved logging with sanitization and consistency |
| apps/auth/urls.py | New app-specific URL configuration for auth routes |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
b6b9c19 to
4ab2b75
Compare
…w, and adjust url to restful
…t, and use plural form in urls
…wvotes through reversed foreignkey
b9b1589 to
1d45ff2
Compare
apps/auth/views.py
Outdated
| verification_data, error_response = verify_token_pwd( | ||
| request, | ||
| action="reset_password", | ||
| action="reset", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make naming consistent. Is it reset or reset_password? reset seems good. Please make sure the whole backend (and later the frontend) uses reset. Docs (docs/auth.nd) need to be updated too.
… unusable passwords
This reverts commit 68b3ed0.
#24 by @A-lexisL