Skip to content

Misc fixes - #678

Merged
jodal merged 18 commits into
mainfrom
misc-fixes
Jul 27, 2026
Merged

Misc fixes#678
jodal merged 18 commits into
mainfrom
misc-fixes

Conversation

@jodal

@jodal jodal commented Jul 27, 2026

Copy link
Copy Markdown
Owner

No description provided.

jodal added 18 commits July 24, 2026 17:40
Replace the hand-rolled method check, which set the non-existent
"Allowed" header, with Django's require_POST decorator, which sets
the correct "Allow" header.
AUTH_PROFILE_MODULE has been a no-op since its removal in Django 1.7,
and TEST_RUNNER only restated the Django default.
feedparser 6.x still warns when accessing updated_parsed on an entry
that only has published_parsed, because attribute access falls back to
the published field for backwards compatibility. Checking containment
with `in` bypasses the fallback, so we no longer trigger the warning
and can drop the blanket warning suppression.
Setting the umask as a side effect of importing the models module dates
back to when downloaded media had to be group-writable for other local
processes. With the containerized setup, a single process writes and
serves the media dir, so the default umask is fine.
The feedback form sent email to settings.ADMINS, which was never
defined, so the feedback was silently sent to no recipients. Define
ADMINS from the DJANGO_ADMINS environment variable, using Django 6's
list-of-addresses format.
Replace naive dt.date.today() with timezone.localdate() in views, and
with the crawler's own current_date property in the crawler base class,
which respects the comic's time zone.
Parse ISO dates with date.fromisoformat() instead of strptime(), and
compute UNIX time from the tz-aware datetime directly instead of going
through time.mktime() with local-time semantics. With all naive
datetime usage gone, enable ruff's flake8-datetimez rules, with an
exception for the generic strptime() in the crawler API's
string_to_date() helper.
The assert statements only narrowed types for the type checker and are
stripped when Python runs with -O, and a missing key in request.POST
would raise a 500 instead of a client error.
The redirect view with its meta-refresh interstitial existed to avoid
leaking referrer traces to the comics' websites, but the sitewide
Referrer-Policy: same-origin header (Django's SECURE_REFERRER_POLICY
default, served by SecurityMiddleware) already stops the browser from
sending any Referer header on cross-origin navigation. The interstitial
added nothing on top of the policy, so remove the view entirely and
link directly to the comics' websites.
rel="start", rel="first", and rel="last" were dropped from the HTML
spec and are ignored by modern browsers; rel="prev"/"next" remain.
@codecov

codecov Bot commented Jul 27, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 42.37288% with 34 lines in your changes missing coverage. Please review.
✅ Project coverage is 60.16%. Comparing base (a62083c) to head (db7444a).

Files with missing lines Patch % Lines
src/comics/browser/views.py 29.62% 19 Missing ⚠️
src/comics/accounts/views.py 40.00% 6 Missing ⚠️
src/comics/aggregator/crawler.py 0.00% 5 Missing ⚠️
src/comics/aggregator/command.py 71.42% 2 Missing ⚠️
src/comics/aggregator/feedparser.py 0.00% 1 Missing ⚠️
src/comics/status/views.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #678      +/-   ##
==========================================
+ Coverage   59.89%   60.16%   +0.27%     
==========================================
  Files          41       41              
  Lines        2057     2036      -21     
==========================================
- Hits         1232     1225       -7     
+ Misses        825      811      -14     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jodal
jodal merged commit 0e0b39f into main Jul 27, 2026
10 of 11 checks passed
@jodal
jodal deleted the misc-fixes branch July 27, 2026 15:32
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