From b8751b080d7fa51ae0f6fa167d9ba48fd53c781e Mon Sep 17 00:00:00 2001 From: Mark Reynolds Date: Dec 13 2016 18:50:13 +0000 Subject: Issue 1662 - update last_updated when editing and deleting comments --- diff --git a/pagure/lib/__init__.py b/pagure/lib/__init__.py index acd5f1e..e34eb1b 100644 --- a/pagure/lib/__init__.py +++ b/pagure/lib/__init__.py @@ -948,6 +948,7 @@ def edit_comment(session, parent, comment, user, comment.editor = user_obj parent.last_updated = comment.edited_on + session.add(parent) session.add(comment) # Make sure we won't have SQLAlchemy error before we continue session.flush() diff --git a/pagure/ui/issues.py b/pagure/ui/issues.py index a6e436c..b4a3c7f 100644 --- a/pagure/ui/issues.py +++ b/pagure/ui/issues.py @@ -171,6 +171,8 @@ def update_issue(repo, issueid, username=None, namespace=None): 'You are not allowed to remove this comment from ' 'this issue') + issue.last_updated = datetime.datetime.utcnow() + SESSION.add(issue) SESSION.delete(comment) try: SESSION.commit()