From f8738b426f22c656b4534dc566361eb7ed0af15c Mon Sep 17 00:00:00 2001 From: danny2637 Date: Wed, 30 Sep 2026 12:21:48 -0400 Subject: [PATCH 1/3] broken link email fix --- config/settings/base.py | 1 - 1 file changed, 1 deletion(-) diff --git a/config/settings/base.py b/config/settings/base.py index 8cf4fdc..f72f99a 100644 --- a/config/settings/base.py +++ b/config/settings/base.py @@ -149,7 +149,6 @@ "django.middleware.csrf.CsrfViewMiddleware", "django.contrib.auth.middleware.AuthenticationMiddleware", "django.contrib.messages.middleware.MessageMiddleware", - "django.middleware.common.BrokenLinkEmailsMiddleware", "django.middleware.clickjacking.XFrameOptionsMiddleware", "reversion.middleware.RevisionMiddleware", "allauth.account.middleware.AccountMiddleware", From 91f2dc5a8722d9d679e8a534f241e15f9bd18acb Mon Sep 17 00:00:00 2001 From: danny2637 Date: Wed, 14 Oct 2026 12:40:29 -0400 Subject: [PATCH 2/3] Stop logging DisallowedHost (bot) errors Bots hitting the ALB by IP trigger DisallowedHost on every request. Django already answers 400; logging them buried real errors and would trigger mail_admins once 500 emails are enabled (#9 in cloud-architecture-dev-ops). Co-Authored-By: Claude Opus 5.5 --- config/settings/production.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/config/settings/production.py b/config/settings/production.py index 1756902..5f56a22 100644 --- a/config/settings/production.py +++ b/config/settings/production.py @@ -187,6 +187,9 @@ "maxBytes": 1024 * 1024 * 15, # 15MB "backupCount": 10, }, + "null": { + "class": "logging.NullHandler", + }, }, "root": {"level": "INFO", "handlers": ["console"]}, "loggers": { @@ -200,10 +203,12 @@ "level": "ERROR", "propagate": True, }, + # Bots hitting the ALB by IP send a Host header not in ALLOWED_HOSTS. + # Django already answers 400; logging these just buries real errors + # (and would trigger mail_admins if that's ever enabled). "django.security.DisallowedHost": { - "level": "ERROR", - "handlers": ["console"], - "propagate": True, + "handlers": ["null"], + "propagate": False, }, "anymail": { "handlers": ["console", "applogfile"], From 9d9d6d491f4496e3836c555633cab69b5b202417 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 14 Oct 2026 17:04:40 +0000 Subject: [PATCH 3/3] Format teleband/dashboards/views.py with black Co-authored-by: hcientist <351751+hcientist@users.noreply.github.com> --- teleband/dashboards/views.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/teleband/dashboards/views.py b/teleband/dashboards/views.py index 6345f6b..d590fc8 100644 --- a/teleband/dashboards/views.py +++ b/teleband/dashboards/views.py @@ -199,8 +199,8 @@ def test_func(self): def get_context_data(self, **kwargs): ctx = super().get_context_data(**kwargs) - ctx["courses"] = ( - Course.objects.select_related("owner").order_by("-start_date", "name") + ctx["courses"] = Course.objects.select_related("owner").order_by( + "-start_date", "name" ) return ctx @@ -238,9 +238,7 @@ def research_data_view(request): atts_by_sub = defaultdict(list) for att in attachments: if att.file: - atts_by_sub[att.submission_id].append( - {"id": att.id, "url": att.file.url} - ) + atts_by_sub[att.submission_id].append({"id": att.id, "url": att.file.url}) subs_by_ca = defaultdict(list) for sub in submissions: @@ -270,9 +268,7 @@ def research_data_view(request): assn_data["submissions"].append( { "id": sub.id, - "student": sub.enrollment.user.id - if sub.enrollment - else None, + "student": sub.enrollment.user.id if sub.enrollment else None, "instrument": str(sub.instrument) if sub.instrument else None, "submitted": sub.submitted.strftime("%Y-%m-%d %H:%M"), "content": sub.content,