diff --git a/seahub/notifications/views.py b/seahub/notifications/views.py index 6351bb7471..2eddd4bcb1 100644 --- a/seahub/notifications/views.py +++ b/seahub/notifications/views.py @@ -1,5 +1,5 @@ -import datetime import simplejson as json +from django.conf import settings from django.core.urlresolvers import reverse from django.contrib import messages from django.http import HttpResponseRedirect, Http404, HttpResponse @@ -8,8 +8,6 @@ from django.template import RequestContext from django.template.loader import render_to_string from django.utils.translation import ugettext as _ -import seaserv - from seahub.auth.decorators import login_required, login_required_ajax from seahub.notifications.models import Notification, NotificationForm, \ UserNotification diff --git a/seahub/views/ajax.py b/seahub/views/ajax.py index 0a3401b69b..c40653131f 100644 --- a/seahub/views/ajax.py +++ b/seahub/views/ajax.py @@ -1341,6 +1341,9 @@ def set_notice_seen_by_id(request): @login_required_ajax def repo_remove(request, repo_id): + ct = 'application/json; charset=utf-8' + result = {} + if get_system_default_repo_id() == repo_id: result['error'] = _(u'System library can not be deleted.') return HttpResponse(json.dumps(result), status=403, content_type=ct)