From 12bcabd0b1288c7d3446f12ba05c14637f14978b Mon Sep 17 00:00:00 2001 From: zhengxie Date: Tue, 13 Jun 2017 10:35:55 +0800 Subject: [PATCH] [share link] Remove deactivate --- seahub/settings.py | 6 +++--- seahub/share/views.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/seahub/settings.py b/seahub/settings.py index 682cefbde4..c24654149e 100644 --- a/seahub/settings.py +++ b/seahub/settings.py @@ -279,6 +279,9 @@ SHARE_LINK_PASSWORD_MIN_LENGTH = 8 # enable or disable share link audit ENABLE_SHARE_LINK_AUDIT = False +# Control the language that send email. Default to user's current language. +SHARE_LINK_EMAIL_LANGUAGE = '' + # check virus for files uploaded form upload link ENABLE_UPLOAD_LINK_VIRUS_CHECK = False @@ -394,9 +397,6 @@ ACTIVATE_AFTER_REGISTRATION = True # This option will be ignored if ``ACTIVATE_AFTER_REGISTRATION`` set to ``True``. REGISTRATION_SEND_MAIL = False -#Control the language that send email. -SHARE_LINK_EMAIL_LANGUAGE = '' - REQUIRE_DETAIL_ON_REGISTRATION = False # Account initial password, for password resetting. diff --git a/seahub/share/views.py b/seahub/share/views.py index 30dcedd08a..35d5145716 100644 --- a/seahub/share/views.py +++ b/seahub/share/views.py @@ -9,7 +9,7 @@ from constance import config from django.core.cache import cache from django.http import HttpResponse, HttpResponseRedirect, Http404, \ HttpResponseBadRequest -from django.utils.translation import ugettext as _, activate, deactivate +from django.utils.translation import ugettext as _, activate from django.contrib import messages from django.utils import timezone from django.utils.html import escape @@ -152,6 +152,7 @@ def send_shared_link(request): if SHARE_LINK_EMAIL_LANGUAGE: activate(SHARE_LINK_EMAIL_LANGUAGE) + # Add email to contacts. mail_sended.send(sender=None, user=request.user.username, email=to_email) @@ -195,7 +196,6 @@ def send_shared_link(request): except Exception: send_failed.append(to_email) - deactivate() if len(send_success) > 0: data = json.dumps({"send_success": send_success, "send_failed": send_failed}) return HttpResponse(data, status=200, content_type=content_type)