Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
swh-web
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Platform
Development
swh-web
Commits
62d620c4
Commit
62d620c4
authored
9 years ago
by
Antoine R. Dumont
Browse files
Options
Downloads
Patches
Plain Diff
Refactor - Rename and unify with doc
parent
fb2efe03
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
swh/web/ui/controller.py
+4
-4
4 additions, 4 deletions
swh/web/ui/controller.py
swh/web/ui/service.py
+4
-4
4 additions, 4 deletions
swh/web/ui/service.py
with
8 additions
and
8 deletions
swh/web/ui/controller.py
+
4
−
4
View file @
62d620c4
...
...
@@ -364,11 +364,11 @@ def api_origin(origin_id):
return
jsonify
({
'
origin
'
:
service
.
lookup_origin
(
origin_id
)})
@app.route
(
'
/api/1/release/<string:
release_id
>
'
)
@app.route
(
'
/api/1/release/<string:
sha1_git
>
'
)
@jsonp
def
api_release
(
release_id
):
"""
Return information about
origin
"""
return
jsonify
({
'
release
'
:
service
.
lookup_release
(
release_id
)})
def
api_release
(
sha1_git
):
"""
Return information about
release with id sha1_git.
"""
return
jsonify
({
'
release
'
:
service
.
lookup_release
(
sha1_git
)})
@app.route
(
'
/api/1/browse/<string:q>/
'
)
...
...
This diff is collapsed.
Click to expand it.
swh/web/ui/service.py
+
4
−
4
View file @
62d620c4
...
...
@@ -82,11 +82,11 @@ def lookup_origin(origin_id):
return
main
.
storage
().
origin_get
({
'
id
'
:
origin_id
})
def
lookup_release
(
release_sha1
):
"""
Return information about the release with sha1 release_sha1.
def
lookup_release
(
release_sha1
_git
):
"""
Return information about the release with sha1 release_sha1
_git
.
Args:
release_sha1: The release
'
s sha1 as hexadecimal
release_sha1
_git
: The release
'
s sha1 as hexadecimal
Returns:
Release information as dict.
...
...
@@ -95,7 +95,7 @@ def lookup_release(release_sha1):
ValueError if the identifier provided is not of sha1 nature.
"""
algo
,
hBinSha1
=
query
.
parse_hash
(
release_sha1
)
algo
,
hBinSha1
=
query
.
parse_hash
(
release_sha1
_git
)
if
algo
!=
'
sha1
'
:
# HACK: sha1_git really but they are both sha1...
raise
ValueError
(
'
Only sha1_git is supported.
'
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment