~sircmpwn/sr.ht-dev

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch

[PATCH dispatch.sr.ht] Indicate a successful 'Save' in github_commit_to_build

Details
Message ID
<20200428171314.42170-1-luca@z3ntu.xyz>
DKIM signature
pass
Download raw message
Patch: +5 -1
Previously there was no sign of the 'Save changes' button doing
anything. Now it displays the 'Changes saved.' message already present
on other pages, such as github_pr_to_build.
---
 dispatchsrht/tasks/github/github_commit_to_build.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/dispatchsrht/tasks/github/github_commit_to_build.py b/dispatchsrht/tasks/github/github_commit_to_build.py
index e6b2892..d7ff279 100644
--- a/dispatchsrht/tasks/github/github_commit_to_build.py
+++ b/dispatchsrht/tasks/github/github_commit_to_build.py
@@ -6,6 +6,7 @@ from dispatchsrht.tasks.github.common import githubloginrequired
from dispatchsrht.tasks.github.common import submit_github_build
from dispatchsrht.types import Task
from flask import Blueprint, redirect, request, render_template, url_for, abort
from flask import session
from github import Github
from jinja2 import Markup
from srht.config import cfg
@@ -56,7 +57,9 @@ class GitHubCommitToBuild(TaskDef):
        ).one_or_none()
        if not record:
            abort(404)
        return render_template("github/edit.html", task=task, record=record)
        saved = session.pop("saved", False)
        return render_template("github/edit.html", task=task, record=record,
                               saved=saved)

    def edit_POST(task):
        record = GitHubCommitToBuild._GitHubCommitToBuildRecord.query.filter(
@@ -66,6 +69,7 @@ class GitHubCommitToBuild(TaskDef):
        secrets = valid.optional("secrets", cls=bool, default=False)
        record.secrets = bool(secrets)
        db.session.commit()
        session["saved"] = True
        return redirect(url_for("html.edit_task", task_id=task.id))

    @csrf_bypass
-- 
2.26.2
Reply to thread Export thread (mbox)