mirror of
https://github.com/haiwen/seahub.git
synced 2025-08-31 06:34:40 +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):
|
||||
repo_id = kwargs.get('repo_id', None)
|
||||
if not repo_id:
|
||||
# TODO: raise error
|
||||
pass
|
||||
raise Exception, 'Repo id is not found in url.'
|
||||
repo = get_repo(repo_id)
|
||||
if not repo:
|
||||
raise Http404
|
||||
username = request.user.username
|
||||
if repo.encrypted and not is_passwd_set(repo_id, username):
|
||||
# Redirect uesr to decrypt repo page.
|
||||
|
Reference in New Issue
Block a user