1
0
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:
zhengxie
2013-03-30 13:52:47 +08:00
parent 33f3fabd74
commit f6738b625f

View File

@@ -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.