Skip to content

Commit

Permalink
Fix: Editing the script no longer breaks the DB
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim020 committed Jun 27, 2023
1 parent 68efe7d commit dbc0020
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions server/controllers/api/show/script.py
Original file line number Diff line number Diff line change
Expand Up @@ -671,6 +671,13 @@ async def patch(self):
if previous_line:
previous_line.next_line = line_object
curr_association.previous_line = previous_line.line

if curr_association.next_line:
next_association: ScriptLineRevisionAssociation = session.query(
ScriptLineRevisionAssociation).get(
{'revision_id': revision.id,
'line_id': curr_association.next_line.id})
next_association.previous_line = line_object
session.flush()

if len(curr_line.revision_associations) == 0:
Expand Down

0 comments on commit dbc0020

Please sign in to comment.