fix: updated_at only changes on actual content edit, not on views/interest
Some checks are pending
NordaBiz Tests / Unit & Integration Tests (push) Waiting to run
NordaBiz Tests / E2E Tests (Playwright) (push) Blocked by required conditions
NordaBiz Tests / Smoke Tests (Production) (push) Blocked by required conditions
NordaBiz Tests / Send Failure Notification (push) Blocked by required conditions
Some checks are pending
NordaBiz Tests / Unit & Integration Tests (push) Waiting to run
NordaBiz Tests / E2E Tests (Playwright) (push) Blocked by required conditions
NordaBiz Tests / Smoke Tests (Production) (push) Blocked by required conditions
NordaBiz Tests / Send Failure Notification (push) Blocked by required conditions
Removed onupdate from Classified.updated_at, set it manually in edit route. Ensures toggle_interest, close, and views don't alter the date. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
79c76b1337
commit
dbe41a62f3
@ -256,6 +256,7 @@ def edit(classified_id):
|
||||
classified.description = request.form.get('description', '').strip()
|
||||
classified.budget_info = sanitize_input(request.form.get('budget_info', ''), 255)
|
||||
classified.location_info = sanitize_input(request.form.get('location_info', ''), 255)
|
||||
classified.updated_at = datetime.now()
|
||||
|
||||
if not classified.title or not classified.description:
|
||||
flash('Tytuł i opis są wymagane.', 'error')
|
||||
|
||||
@ -2561,7 +2561,7 @@ class Classified(Base):
|
||||
views_count = Column(Integer, default=0)
|
||||
|
||||
created_at = Column(DateTime, default=datetime.now)
|
||||
updated_at = Column(DateTime, default=datetime.now, onupdate=datetime.now)
|
||||
updated_at = Column(DateTime, default=datetime.now) # set manually in edit route only
|
||||
|
||||
author = relationship('User', backref='classifieds')
|
||||
company = relationship('Company')
|
||||
|
||||
Loading…
Reference in New Issue
Block a user