1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-16 07:08:55 +00:00

Fixed recomend file in encrypt repo

This commit is contained in:
xiez
2012-09-26 20:44:15 +08:00
parent 64bd2247bb
commit bbb091659d
2 changed files with 10 additions and 1 deletions

View File

@@ -209,6 +209,9 @@ class RepoMixin(object):
return current_commit
def get_success_url(self):
next = self.request.GET.get('next', '')
if next:
return next
return reverse('repo', args=[self.repo_id])
def prepare_property(self):
@@ -1065,6 +1068,12 @@ def repo_view_file(request, repo_id):
if not repo:
raise Http404
if repo.encrypted and not is_passwd_set(repo_id, request.user.username):
# Redirect uesr to decrypt repo page.
return render_to_response('decrypt_repo_form.html', {
'repo': repo,
'next': request.get_full_path(),
}, context_instance=RequestContext(request))
permission = get_user_permission(request, repo_id)
if permission:
# Get a token to visit file