fix: project setup, security, dependency updates, and code quality#584
Conversation
Remove google-services.json from tracking and add it to .gitignore. Add a .json.template placeholder with dummy values so developers know the file structure. Update README to reflect auto-created admin user. The leaked key (AIzaSyDsA2wgQIw-bVgwODNMIF482gVRn5xdANU) must still be revoked in Google Cloud Console by the project owner. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace str(e) in error responses with generic messages and log the actual exceptions server-side. Fixes all 9 CodeQL "information exposure through an exception" alerts. - auth_views.py: Google OAuth token validation error - invoices/public_views.py: invoice and estimate PDF generation (4 sites) - invoices/api_views.py: invoice and estimate PDF generation (4 sites) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Bump 6 packages and pin 5 previously unpinned ones: - django 5.2.9 → 5.2.11 (latest 5.x LTS) - celery 5.6.0 → 5.6.2 - django-ses 4.4.0 → 4.7.1 - sentry-sdk 2.47.0 → 2.53.0 - redis 7.1.0 → 7.2.0 - faker 33.1.0 → 40.4.0 - python-dateutil, google-auth, weasyprint, cairocffi, gunicorn pinned to latest for reproducible builds Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Update 19 packages via ncu: - svelte 5.46.1 → 5.51.2 - @sveltejs/kit 2.49.2 → 2.52.0 - eslint 9.39.2 → 10.0.0 - vite 7.3.0 → 7.3.1 - bits-ui 2.14.4 → 2.15.6 - prettier 3.7.4 → 3.8.1 - axios 1.13.2 → 1.13.5 - and 12 other minor/patch bumps Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Fix missing `import json` in leads and opportunity views (runtime bugs) - Remove ~60 unused imports across 30+ files - Remove unused variables and dead code assignments - Convert f-string logging to lazy % formatting (41 instances) - Chain exceptions with `from exc` for proper tracebacks - Replace mutable default arguments with None guards - Fix invalid escape sequences, set comprehensions, f-strings - Remove unnecessary else/elif after return/raise/continue - Modernize: super() without args, remove object inheritance - Replace wildcard import with explicit imports in contacts/views - Fix wrong-import-position in invoices and auth views - Add noqa comments for intentional side-effect imports - Add encoding parameter to open() call - Fix renamed parameter in serializer validate override Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add .prospector.yaml config to suppress Django/DRF false positives, replace custom reverse_noop with migrations.RunPython.noop, move deferred imports to module top level, and fix genuine unused import/variable issues. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds django-settings-module option to pylint config so Prospector runs cleanly without needing DJANGO_SETTINGS_MODULE env var set. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Caution Review failedThe pull request is closed. 📝 WalkthroughWalkthroughThis PR performs broad code cleanup and modernization across the backend codebase, including removing unused imports and custom migration functions, replacing them with Django built-ins, converting logging to parameterized format, updating class signatures to modern Python, and refactoring control flow in views and forms. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~75 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…email-recipients # Conflicts: # backend/common/views/auth_views.py # backend/invoices/api_views.py
Summary
Changes
.dockerignore,.env.docker,docker/scripts, and updateDockerfileanddocker-compose.ymlcreate_default_adminmanagement commandrequirements.txtandfrontend/package.jsonto latest versions.prospector.yamlwith pylint/mccabe configurationTest plan
docker compose upcd backend && ./venv/bin/python -m prospector --without-tool pep257🤖 Generated with Claude Code
Summary by CodeRabbit
Release Notes
Bug Fixes
Refactor
Chores