mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-03 07:55:36 +00:00
Handle the case that repo is not found in repo_passwd_set decrator
This commit is contained in:
@@ -57,9 +57,10 @@ def repo_passwd_set_required(func):
|
|||||||
def _decorated(request, *args, **kwargs):
|
def _decorated(request, *args, **kwargs):
|
||||||
repo_id = kwargs.get('repo_id', None)
|
repo_id = kwargs.get('repo_id', None)
|
||||||
if not repo_id:
|
if not repo_id:
|
||||||
# TODO: raise error
|
raise Exception, 'Repo id is not found in url.'
|
||||||
pass
|
|
||||||
repo = get_repo(repo_id)
|
repo = get_repo(repo_id)
|
||||||
|
if not repo:
|
||||||
|
raise Http404
|
||||||
username = request.user.username
|
username = request.user.username
|
||||||
if repo.encrypted and not is_passwd_set(repo_id, username):
|
if repo.encrypted and not is_passwd_set(repo_id, username):
|
||||||
# Redirect uesr to decrypt repo page.
|
# Redirect uesr to decrypt repo page.
|
||||||
|
Reference in New Issue
Block a user