增加设置中url格式的提示,防止拼接url的时候出现多余的/符号

This commit is contained in:
virusdefender 2016-03-28 18:13:08 +08:00
parent be4fc9f88f
commit fd790453a1
2 changed files with 2 additions and 2 deletions

View File

@ -330,8 +330,7 @@ class ApplyResetPasswordAPIView(APIView):
email_template = email_template.replace("{{ username }}", user.username). \
replace("{{ website_name }}", settings.WEBSITE_INFO["website_name"]). \
replace("{{ link }}", request.scheme + "://"
+ request.META['HTTP_HOST'] + "/reset_password/t/" +
replace("{{ link }}", settings.WEBSITE_INFO["url"] + "/reset_password/t/" +
user.reset_password_token)
_send_email.delay(settings.WEBSITE_INFO["website_name"],

View File

@ -5,6 +5,7 @@ import os
WEBSITE_INFO = {"website_name": u"example大学 OnlineJudge",
"website_name_shortcut": u"example oj",
"website_footer": u"example大学信息学院<a href=\"http://www.miibeian.gov.cn/\">京ICP备xxxxx号-1</a>",
# url结尾没有/
"url": u"https://your-domain-or-ip.com"}