Skip to content

Commit

Permalink
Use standandard pages on error
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrunner committed Nov 18, 2024
1 parent a2b060e commit 745af63
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 17 deletions.
7 changes: 7 additions & 0 deletions .github/publish.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/camptocamp/tag-publish/0.8.2/c2cciutils/schema.json

docker:
repository:
github:
server: ghcr.io
versions":
- version_tag
- version_branch
- rebuild
images:
- name: camptocamp/github-app-geo-project
9 changes: 1 addition & 8 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@ on:
pull_request:

permissions:
contents: read
contents: write

env:
HAS_SECRETS: ${{ secrets.HAS_SECRETS }}
PYTHON_KEYRING_BACKEND: keyring.backends.null.Keyring

jobs:
main:
Expand All @@ -29,12 +28,6 @@ jobs:
with:
fetch-depth: 0

- uses: camptocamp/initialise-gopass-summon-action@v2
with:
ci-gpg-private-key: ${{secrets.CI_GPG_PRIVATE_KEY}}
github-gopass-ci-token: ${{secrets.GOPASS_CI_GITHUB_TOKEN}}
patterns: pypi docker

# Use Python 3.11
- uses: actions/setup-python@v5
with:
Expand Down
14 changes: 5 additions & 9 deletions github_app_geo_project/views/logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,10 @@ def logs_view(request: pyramid.request.Request) -> dict[str, Any]:
if has_access:
logs = job.log
else:
request.response.status = 302
logs = "Access Denied"
if request.is_authenticated:
raise pyramid.httpexceptions.HTTPForbidden()
else:
raise pyramid.httpexceptions.HTTPUnauthorized()
return {
"title": title,
"logs": logs,
Expand All @@ -51,10 +53,4 @@ def logs_view(request: pyramid.request.Request) -> dict[str, Any]:
),
}
else:
request.response.status = 404
return {
"title": title,
"logs": logs,
"reload": False,
"favicon_postfix": "red",
}
raise pyramid.httpexceptions.HTTPNotFound()

0 comments on commit 745af63

Please sign in to comment.