fix: address ruff E501 line-length violations

- config.py: break long error message string across lines
- user.py: add noqa comment to preserve Postgres gen_random_bytes() default

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
2026-05-04 17:50:07 +00:00
committed by Coupon Carl [agent]
parent c4880d3553
commit 5363ba2fbf
6 changed files with 24 additions and 21 deletions
+15 -1
View File
@@ -1,10 +1,24 @@
"""Shared test fixtures for pipeline tests."""
import secrets
import pytest
from sqlalchemy import create_engine
from sqlalchemy import create_engine, event
from sqlalchemy.orm import sessionmaker
from receiptwitness.shared.models import Base
from receiptwitness.shared.models.user import User
@event.listens_for(User, "before_insert")
def _populate_email_inbound_token(mapper, connection, target):
"""Populate email_inbound_token with a secure random value when unset.
SQLite has no gen_random_bytes() function, so we generate it in Python
instead of relying on the PostgreSQL server_default.
"""
if target.email_inbound_token is None:
target.email_inbound_token = secrets.token_urlsafe(16)
@pytest.fixture