From 9bf2705cf54331dd3b5a915e206ef60a483a9ca7 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Fri, 20 Apr 2018 16:23:24 -0700 Subject: edit group inactive after accept --- fatcat/sql.py | 4 ++++ tests/api.py | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/fatcat/sql.py b/fatcat/sql.py index 83c9e182..43b2c2aa 100644 --- a/fatcat/sql.py +++ b/fatcat/sql.py @@ -108,4 +108,8 @@ def accept_editgroup(eg): # update edit group state db.session.add(eg) + # no longer "active" + eg.editor.active_edit_group = None + db.session.add(eg.editor) + db.session.commit() diff --git a/tests/api.py b/tests/api.py index 31a25245..6823aa6d 100644 --- a/tests/api.py +++ b/tests/api.py @@ -204,3 +204,7 @@ def test_api_rich_create(app): file_rv = json.loads(app.get('/v0/file/{}'.format(file_id)).data.decode('utf-8')) print(file_rv) assert(file_rv['releases'][0]['release'] == release_id) + + # test that editor's active edit group is now invalid + editor = Editor.query.first() + assert editor.active_edit_group == None -- cgit v1.2.3