Closed devxpy closed 1 month ago
imo we should also remove is_update_mode
. having a flag is much more confusing than just having separate methods separate methods or an if branch at the very end.
we can do something like
def _save_or_update_and_redirect(self, title: str, notes: str, published_run: PublishedRun | None):
if published_run and self.can_user_edit_published_run(published_run):
version = published_run.add_version(...)
else:
pr = self.create_published_run(...)
raise gui.RedirectException(pr.get_app_url())
and in the publish modal,
if pressed_save:
self._save_or_update_and_redirect(title=title, notes=notes)
or this can be something like - if published_run
was passed then add a new version and redirect. or create a new PR instead
Q/A checklist
To measure import time for a specific library:
Executed in 1.15 secs fish external usr time 2.22 secs 86.00 micros 2.22 secs sys time 0.72 secs 613.00 micros 0.72 secs
Legal Boilerplate
Look, I get it. The entity doing business as “Gooey.AI” and/or “Dara.network” was incorporated in the State of Delaware in 2020 as Dara Network Inc. and is gonna need some rights from me in order to utilize my contributions in this PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Dara Network Inc can use, modify, copy, and redistribute my contributions, under its choice of terms.