From 78ee5fc5922aa1bfb25071c0d114d65a5345c317 Mon Sep 17 00:00:00 2001 From: Mike Lang Date: Fri, 2 Sep 2022 16:14:20 +1000 Subject: [PATCH] sheetsync: Show unlisted videos in DONE state as UNLISTED instead We don't actually want to represent them as a different state in the backend, but showing them differently on the sheet is helpful to humans. --- sheetsync/sheetsync/main.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sheetsync/sheetsync/main.py b/sheetsync/sheetsync/main.py index 2717857..3bf0cb1 100644 --- a/sheetsync/sheetsync/main.py +++ b/sheetsync/sheetsync/main.py @@ -299,6 +299,12 @@ class SheetSync(object): if event.error is None and row['_parse_errors']: event = event._replace(error=", ".join(row['_parse_errors'])) + # As a presentation detail, we show any row in state DONE with public = False as + # a virtual state UNLISTED instead, to indicate that it probably still requires other + # work before being modified to be public = True later. + if event.state == 'DONE' and not event.public: + event = event._replace(state='UNLISTED') + # Update database with any changed inputs changed = [col for col in self.input_columns if row[col] != getattr(event, col)] if changed: