1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-16 23:29:49 +00:00

Fixed name conflict in unset pub repo, and improve message

This commit is contained in:
zhengxie
2013-02-22 17:00:47 +08:00
parent 2dce824661
commit 3e3718d017
3 changed files with 10 additions and 6 deletions

View File

@@ -60,7 +60,7 @@
{% endif %}
{% if repo.props.share_type == 'public' %}
{% if not org %}
<a href="#" data="{{ SITE_ROOT }}repo/unsetinnerpub/{{ repo.props.repo_id }}" class="cancel-share op">{% trans "Unshare"%}</a>
<a href="#" data="{% url 'unsetinnerpub' repo.repo_id %}" class="cancel-share op">{% trans "Unshare"%}</a>
{% else %}
<a href="#" data="{{ SITE_ROOT }}organizations/{{ org.url_prefix }}/innerpubrepo/unset/{{ repo.props.repo_id }}" class="cancel-share op">{% trans "Unshare"%}</a>
{% endif %}

View File

@@ -35,7 +35,7 @@ urlpatterns = patterns('',
(r'^repo/create/$', repo_create),
(r'^repo/upload_check/$', validate_filename),
(r'^repo/file_rename/$', repo_rename_file),
(r'^repo/unsetinnerpub/(?P<repo_id>[-0-9a-f]{36})/$', unset_inner_pub_repo),
url(r'^repo/unsetinnerpub/(?P<repo_id>[-0-9a-f]{36})/$', unsetinnerpub, name='unsetinnerpub'),
url(r'^repo/set_password/$', repo_set_password, name="repo_set_password"),
url(r'^repo/revert_file/(?P<repo_id>[-0-9a-f]{36})/$', repo_revert_file, name='repo_revert_file'),
url(r'^repo/revert_dir/(?P<repo_id>[-0-9a-f]{36})/$', repo_revert_dir, name='repo_revert_dir'),

View File

@@ -1177,13 +1177,17 @@ def public_repo_create(request):
content_type=content_type)
@login_required
def unset_inner_pub_repo(request, repo_id):
def unsetinnerpub(request, repo_id):
repo = get_repo(repo_id)
if not repo:
messages.error(request, _('Failed to unshare library. Library does not exist.'))
return HttpResponseRedirect(reverse('share_admin'))
try:
unset_inner_pub_repo(repo_id)
messages.success(request, _('Operation successful'))
messages.success(request, _('Unshare "%s" successfully.' % repo.name))
except SearpcError:
messages.error(request, _('Operation failed'))
messages.error(request, _('Failed to unshare "%s".' % repo.name))
return HttpResponseRedirect(reverse('share_admin'))
@login_required