2
0
Эх сурвалжийг харах

이메일 전송 실패 오류 추가

Surplus_Up (2DU) 6 жил өмнө
parent
commit
8018c2dce1

+ 2 - 1
language/en-US.json

@@ -391,5 +391,6 @@
             "application_not_found" : "Application not found",
             "invalid_password_error" : "The Password or ID is invalid.",
             "watchlist_overflow_error": "You cannot add more than ten documents.",
-            "copyright_disagreed" : "You have to agree copyright noticement to contribute"
+            "copyright_disagreed" : "You have to agree copyright noticement to contribute",
+            "email_send_error" : "Email transfer failed."
 }

+ 2 - 1
language/ko-KR.json

@@ -367,5 +367,6 @@
     "enter_html" : "HTML을 입력하세요.",
     "exp_edit_conflict" : "편집 충돌 발생",
     "backup_where" : "백업 위치",
-    "empty" : "빈칸"
+    "empty" : "빈칸",
+    "email_send_error" : "이메일 전송이 실패했습니다."
 }

+ 5 - 2
route/login_need_email.py

@@ -27,7 +27,8 @@ def login_need_email_2(conn, tool):
                 else:
                     i_text = 'Key : ' + flask.session['c_key']
 
-                send_email(flask.request.form.get('email', ''), t_text, i_text)
+                if send_email(flask.request.form.get('email', ''), t_text, i_text) == 0:
+                    return re_error('/error/18')
 
                 return redirect('/check_pass_key')
             else:
@@ -68,7 +69,9 @@ def login_need_email_2(conn, tool):
                             else:
                                 i_text = 'Key : ' + flask.session['c_key']
 
-                            send_email(flask.request.form.get('email', ''), t_text, i_text)
+                            if send_email(flask.request.form.get('email', ''), t_text, i_text) == 0:
+                                return re_error('/error/18')
+
                             flask.session['c_email'] = flask.request.form.get('email', '')
 
                             if tool == 'email_change':

+ 6 - 0
route/tool/func.py

@@ -116,11 +116,15 @@ def send_email(who, title, data):
         smtp.sendmail(smtp_email, who, msg.as_string())
 
         smtp.quit()
+
+        return 1
     except Exception as e:
         print('----')
         print('Error : Email send error')
         print(e)
 
+        return 0
+
 def last_change(data):
     json_address = re.sub(r"(((?!\.|\/).)+)\.html$", "set.json", skin_check())
     try:
@@ -1229,6 +1233,8 @@ def re_error(data):
             data = load_lang('same_file_error')
         elif num == 17:
             data = load_lang('file_capacity_error') + wiki_set(3)
+        elif num == 18:
+            data = load_lang('email_send_error')
         elif num == 19:
             data = load_lang('decument_exist_error')
         elif num == 20: