~sircmpwn/dispatch.sr.ht

852f3e653d153aac0b1fc24b568d582cccc99eb8 — Drew DeVault 4 months ago 6b664bf 0.12.4
Handle case where GitHub repo has been deleted
M dispatchsrht/tasks/github/github_pr_to_build.py => dispatchsrht/tasks/github/github_pr_to_build.py +5 -1
@@ 63,7 63,11 @@ class GitHubPRToBuild(TaskDef):
            GitHubAuthorization.user_id == current_user.id
        ).first()
        github = Github(auth.oauth_token)
        repo = github.get_repo(record.repo)
        try:
            repo = github.get_repo(record.repo)
        except github.GithubException.UnknownObjectException:
            return render_template("github/missing.html",
                    task=task, record=record)
        if repo.private != record.private:
            record.private = repo.private
            if not repo.private:

A dispatchsrht/templates/github/missing.html => dispatchsrht/templates/github/missing.html +15 -0
@@ 0,0 1,15 @@
{% extends "edit.html" %}
{% block content %}
<div class="col-md-12">
  <p>
    The repository associated with this task has been deleted, or is no longer
    visible to us. Would you like to delete this task?
  </p>
  <form method="POST" action="{{url_for('html.delete_task', task_id=task.id)}}">
    {{csrf_token()}}
    <button type="submit" class="btn btn-danger">
      Delete task {{icon("caret-right")}}
    </button>
  </form>
</div>
{% endblock %}