Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
D
douban-api-proxy
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
captainwong
douban-api-proxy
Commits
436c2671
Commit
436c2671
authored
6 years ago
by
Ozzieisaacs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix delete domain entries
Fix error handling smtp.authentication error
parent
a669eacd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
6 deletions
+5
-6
table.js
cps/static/js/table.js
+3
-2
worker.py
cps/worker.py
+2
-4
No files found.
cps/static/js/table.js
View file @
436c2671
...
@@ -65,11 +65,12 @@ $(function() {
...
@@ -65,11 +65,12 @@ $(function() {
});
});
});
});
/*function TableActions (value, row, index) {
/* Function for deleting domain restrictions */
function
TableActions
(
value
,
row
,
index
)
{
return
[
return
[
"<a class=
\"
danger remove
\"
data-toggle=
\"
modal
\"
data-target=
\"
#DeleteDomain
\"
data-domain-id=
\"
"
+
row
.
id
"<a class=
\"
danger remove
\"
data-toggle=
\"
modal
\"
data-target=
\"
#DeleteDomain
\"
data-domain-id=
\"
"
+
row
.
id
+
"
\"
title=
\"
Remove
\"
>"
,
+
"
\"
title=
\"
Remove
\"
>"
,
"<i class=
\"
glyphicon glyphicon-trash
\"
></i>"
,
"<i class=
\"
glyphicon glyphicon-trash
\"
></i>"
,
"</a>"
"</a>"
].
join
(
""
);
].
join
(
""
);
}
*/
}
This diff is collapsed.
Click to expand it.
cps/worker.py
View file @
436c2671
...
@@ -468,9 +468,9 @@ class WorkerThread(threading.Thread):
...
@@ -468,9 +468,9 @@ class WorkerThread(threading.Thread):
except
(
MemoryError
)
as
e
:
except
(
MemoryError
)
as
e
:
self
.
_handleError
(
u'Error sending email: '
+
e
.
message
)
self
.
_handleError
(
u'Error sending email: '
+
e
.
message
)
return
None
return
None
except
(
smtplib
.
SMTPException
)
as
e
:
except
(
smtplib
.
SMTPException
,
smtplib
.
SMTPAuthenticationError
)
as
e
:
if
hasattr
(
e
,
"smtp_error"
):
if
hasattr
(
e
,
"smtp_error"
):
text
=
e
.
smtp_error
.
replace
(
"
\n
"
,
'. '
)
text
=
e
.
smtp_error
.
decode
(
'utf-8'
)
.
replace
(
"
\n
"
,
'. '
)
elif
hasattr
(
e
,
"message"
):
elif
hasattr
(
e
,
"message"
):
text
=
e
.
message
text
=
e
.
message
else
:
else
:
...
@@ -495,7 +495,6 @@ class WorkerThread(threading.Thread):
...
@@ -495,7 +495,6 @@ class WorkerThread(threading.Thread):
def
_handleError
(
self
,
error_message
):
def
_handleError
(
self
,
error_message
):
web
.
app
.
logger
.
error
(
error_message
)
web
.
app
.
logger
.
error
(
error_message
)
# self.queue[self.current]['status'] = STAT_FAIL
self
.
UIqueue
[
self
.
current
][
'stat'
]
=
STAT_FAIL
self
.
UIqueue
[
self
.
current
][
'stat'
]
=
STAT_FAIL
self
.
UIqueue
[
self
.
current
][
'progress'
]
=
"100
%
"
self
.
UIqueue
[
self
.
current
][
'progress'
]
=
"100
%
"
self
.
UIqueue
[
self
.
current
][
'runtime'
]
=
self
.
_formatRuntime
(
self
.
UIqueue
[
self
.
current
][
'runtime'
]
=
self
.
_formatRuntime
(
...
@@ -503,7 +502,6 @@ class WorkerThread(threading.Thread):
...
@@ -503,7 +502,6 @@ class WorkerThread(threading.Thread):
self
.
UIqueue
[
self
.
current
][
'message'
]
=
error_message
self
.
UIqueue
[
self
.
current
][
'message'
]
=
error_message
def
_handleSuccess
(
self
):
def
_handleSuccess
(
self
):
# self.queue[self.current]['status'] = STAT_FINISH_SUCCESS
self
.
UIqueue
[
self
.
current
][
'stat'
]
=
STAT_FINISH_SUCCESS
self
.
UIqueue
[
self
.
current
][
'stat'
]
=
STAT_FINISH_SUCCESS
self
.
UIqueue
[
self
.
current
][
'progress'
]
=
"100
%
"
self
.
UIqueue
[
self
.
current
][
'progress'
]
=
"100
%
"
self
.
UIqueue
[
self
.
current
][
'runtime'
]
=
self
.
_formatRuntime
(
self
.
UIqueue
[
self
.
current
][
'runtime'
]
=
self
.
_formatRuntime
(
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment