-
-
Notifications
You must be signed in to change notification settings - Fork 313
Integrate newsletter feature from PR #3939 #4847
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
base: main
Are you sure you want to change the base?
Conversation
|
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the Comment |
Co-authored-by: DonnieBLT <[email protected]>
Co-authored-by: DonnieBLT <[email protected]>
❌ Pre-commit checks failedThe pre-commit hooks found issues that need to be fixed. Please run the following commands locally to fix them: # Install pre-commit if you haven't already
pip install pre-commit
# Run pre-commit on all files
pre-commit run --all-files
# Or run pre-commit on staged files only
pre-commit runAfter running these commands, the pre-commit hooks will automatically fix most issues. 💡 Tip: You can set up pre-commit to run automatically on every commit by running: pre-commit installFor more information, see the pre-commit documentation. |
| messages.error(request, "Email address is required.") | ||
| return redirect("newsletter_subscribe") | ||
|
|
||
| if not re.match(r"[^@]+@[^@]+\.[^@]+", email): |
Check failure
Code scanning / CodeQL
Polynomial regular expression used on uncontrolled data High
regular expression
user-provided value
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.
@copilot fix Polynomial regular expression used on uncontrolled data
Check failure: Polynomial regular expression used on uncontrolled data
This regular expression that depends on a user-provided value may run slow on strings with many repetitions of '?'.
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.
Why not just use the built-in function?
from django.core.validators import validate_email
from django.core.exceptions import ValidationError
try:
validate_email(email)
except ValidationError:
| data = json.loads(request.body) | ||
| email = data.get("email") | ||
|
|
||
| if not email or not re.match(r"[^@]+@[^@]+\.[^@]+", email): |
Check failure
Code scanning / CodeQL
Polynomial regular expression used on uncontrolled data High
regular expression
user-provided value
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.
could again use the built-in django validator? or a simpler approach like:
if "@" not in email or "." not in email.split("@")[-1]:
messages.error(request, "Please enter a valid email address.")
return redirect("newsletter_subscribe")
|
👋 Hi @Copilot! This pull request needs a peer review before it can be merged. Please request a review from a team member who is not:
Once a valid peer review is submitted, this check will pass automatically. Thank you! |
❌ Pre-commit checks failedThe pre-commit hooks found issues that need to be fixed. Please run the following commands locally to fix them: # Install pre-commit if you haven't already
pip install pre-commit
# Run pre-commit on all files
pre-commit run --all-files
# Or run pre-commit on staged files only
pre-commit runAfter running these commands, the pre-commit hooks will automatically fix most issues. 💡 Tip: You can set up pre-commit to run automatically on every commit by running: pre-commit installPre-commit outputFor more information, see the pre-commit documentation. |
❌ Pre-commit checks failedThe pre-commit hooks found issues that need to be fixed. Please run the following commands locally to fix them: # Install pre-commit if you haven't already
pip install pre-commit
# Run pre-commit on all files
pre-commit run --all-files
# Or run pre-commit on staged files only
pre-commit runAfter running these commands, the pre-commit hooks will automatically fix most issues. 💡 Tip: You can set up pre-commit to run automatically on every commit by running: pre-commit installPre-commit outputFor more information, see the pre-commit documentation. |
Co-authored-by: DonnieBLT <[email protected]>
Fixed both issues:
All pre-commit checks now pass. (commit e31dea2) |
❌ Tests failedThe Django tests found issues that need to be fixed. Please review the test output below and fix the failing tests. How to run tests locally# Install dependencies
poetry install --with dev
# Run all tests
poetry run python manage.py test
# Run tests with verbose output
poetry run python manage.py test -v 3
# Run a specific test
poetry run python manage.py test app.tests.TestClass.test_methodTest outputFor more information, see the Django testing documentation. |
|
@copilot please fix the migrations |
Co-authored-by: DonnieBLT <[email protected]>
- Merged PR OWASP-BLT#4847's email subscription functionality into newsletter feature - Added subscribe/archive buttons to newsletter stats page header - Changed newsletter archive URL from /newsletter/ to /newsletter/archive/ to avoid conflicts - Fixed duplicate Meta class in StakingTransaction model (merge artifact) - Fixed Activity creation in newsletter_home view when no newsletters exist - Newsletter stats page at /newsletter/ with subscription at /newsletter/subscribe/
|
📅 PR Updated This pull request was last updated on: Sat, 06 Dec 2025 06:38:29 GMT This comment is automatically updated when the PR is synchronized with the base branch. |
Newsletter Feature Integration from PR #3939
Integrates comprehensive newsletter functionality from PR #3939, including subscription management, email distribution, and admin interface.
Completed Tasks
Latest Changes
0259_newsletter_newslettersubscriber.pythat depends on0258_add_slackchannel_modeldark:Tailwind CSS classes to all newsletter templates (home, detail, subscribe, preferences) for proper dark mode support{# djlint:off H021 #}to email templates since inline styles are required for email client compatibilityTemplates Updated
newsletter/home.html- Dark mode stylingnewsletter/detail.html- Dark mode stylingnewsletter/subscribe.html- Dark mode stylingnewsletter/preferences.html- Dark mode stylingnewsletter/email/newsletter_email.html- djLint ignore for email stylesnewsletter/email/confirmation_email.html- djLint ignore for email stylesMigration Details
Migration 0259: Newsletter tables creation
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.