Small fixes for GitLab trigger handler, since the GitLab API is returning the wrong ID for the user's namespace
Also has a small UI improvement
This commit is contained in:
parent
0b0bd156f7
commit
63ed683dfa
3 changed files with 13 additions and 8 deletions
|
@ -268,7 +268,7 @@ def namespaces_handler(_, request):
|
|||
|
||||
|
||||
def get_projects_handler(add_permissions_block):
|
||||
@urlmatch(netloc=r'fakegitlab', path=r'/api/v4/groups/someorg/projects$')
|
||||
@urlmatch(netloc=r'fakegitlab', path=r'/api/v4/groups/2/projects$')
|
||||
def projects_handler(_, request):
|
||||
if not request.headers.get('Authorization') == 'Bearer foobar':
|
||||
return {'status_code': 401}
|
||||
|
@ -317,7 +317,7 @@ def get_projects_handler(add_permissions_block):
|
|||
|
||||
|
||||
def get_group_handler(null_avatar):
|
||||
@urlmatch(netloc=r'fakegitlab', path=r'/api/v4/groups/someorg$')
|
||||
@urlmatch(netloc=r'fakegitlab', path=r'/api/v4/groups/2$')
|
||||
def group_handler(_, request):
|
||||
if not request.headers.get('Authorization') == 'Bearer foobar':
|
||||
return {'status_code': 401}
|
||||
|
@ -546,7 +546,7 @@ def delete_deploykey_handker(_, request):
|
|||
}
|
||||
|
||||
|
||||
@urlmatch(netloc=r'fakegitlab', path=r'/api/v4/users/knownuser/projects$')
|
||||
@urlmatch(netloc=r'fakegitlab', path=r'/api/v4/users/2/projects$')
|
||||
def user_projects_list_handler(_, request):
|
||||
if not request.headers.get('Authorization') == 'Bearer foobar':
|
||||
return {'status_code': 401}
|
||||
|
|
Reference in a new issue