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
0b5b3b84
Commit
0b5b3b84
authored
Aug 02, 2015
by
Jan Broer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
User edit email fix
parent
aef608aa
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
10 deletions
+10
-10
user_edit.html
cps/templates/user_edit.html
+5
-5
ub.py
cps/ub.py
+1
-1
web.py
cps/web.py
+4
-4
No files found.
cps/templates/user_edit.html
View file @
0b5b3b84
...
...
@@ -5,7 +5,7 @@
<form
role=
"form"
method=
"POST"
>
<div
class=
"form-group"
>
<label
for=
"email"
>
e-mail
</label>
<input
type=
"email"
class=
"form-control"
name=
"email"
id=
"email"
value=
"{{
content.email}}"
>
<input
type=
"email"
class=
"form-control"
name=
"email"
id=
"email"
value=
"{{
content.email if content.email != None }}"
>
</div>
<div
class=
"form-group"
>
<label
for=
"password"
>
password
</label>
...
...
@@ -13,16 +13,16 @@
</div>
<div
class=
"form-group"
>
<label
for=
"kindle_mail"
>
Kindle E-Mail
</label>
<input
type=
"text"
class=
"form-control"
name=
"kindle_mail"
id=
"kindle_mail"
value=
"{{
content.kindle_mail
}}"
>
<input
type=
"text"
class=
"form-control"
name=
"kindle_mail"
id=
"kindle_mail"
value=
"{{
content.kindle_mail if content.kindle_mail != None
}}"
>
</div>
{% if g.user and g.user.role %}
<div
class=
"form-group"
>
<label
for=
"user_role"
>
is admin
</label>
<input
type=
"text"
class=
"form-control"
name=
"user_role"
id=
"user_role"
value=
"{{
content.role
}}"
>
<label
for=
"user_role"
>
Admin user? 0 or 1
</label>
<input
type=
"text"
class=
"form-control"
name=
"user_role"
id=
"user_role"
value=
"{{
content.role if content.role != None
}}"
>
</div>
<div
class=
"form-group"
>
<label
for=
"nickname"
>
nickname
</label>
<input
type=
"text"
class=
"form-control"
name=
"nickname"
id=
"nickname"
value=
"{{
content.nickname
}}"
>
<input
type=
"text"
class=
"form-control"
name=
"nickname"
id=
"nickname"
value=
"{{
content.nickname if content.nickname != None
}}"
>
</div>
<div
class=
"checkbox"
>
<label>
...
...
cps/ub.py
View file @
0b5b3b84
...
...
@@ -21,7 +21,7 @@ class User(Base):
id
=
Column
(
Integer
,
primary_key
=
True
)
nickname
=
Column
(
String
(
64
),
unique
=
True
)
email
=
Column
(
String
(
120
),
unique
=
True
)
email
=
Column
(
String
(
120
),
unique
=
True
,
default
=
""
)
role
=
Column
(
SmallInteger
,
default
=
ROLE_USER
)
password
=
Column
(
String
)
kindle_mail
=
Column
(
String
(
120
),
default
=
""
)
...
...
cps/web.py
View file @
0b5b3b84
...
...
@@ -324,16 +324,16 @@ def logout():
def
send_to_kindle
(
book_id
):
settings
=
ub
.
get_mail_settings
()
if
settings
.
get
(
"mail_server"
,
"mail.example.com"
)
==
"mail.example.com"
:
flash
(
"
please configure your email account settings
first..."
,
category
=
"error"
)
flash
(
"
Please configure the SMTP email account
first..."
,
category
=
"error"
)
elif
current_user
.
kindle_mail
:
x
=
helper
.
send_mail
(
book_id
,
current_user
.
kindle_mail
)
if
x
:
flash
(
"
m
ail successfully send to
%
s"
%
current_user
.
kindle_mail
,
category
=
"success"
)
flash
(
"
M
ail successfully send to
%
s"
%
current_user
.
kindle_mail
,
category
=
"success"
)
helper
.
update_download
(
book_id
,
int
(
current_user
.
id
))
else
:
flash
(
"
t
here was an error sending this book"
,
category
=
"error"
)
flash
(
"
T
here was an error sending this book"
,
category
=
"error"
)
else
:
flash
(
"
p
lease set a kindle mail first..."
,
category
=
"error"
)
flash
(
"
P
lease set a kindle mail first..."
,
category
=
"error"
)
return
redirect
(
request
.
environ
[
"HTTP_REFERER"
])
@
app
.
route
(
"/shelf/add/<int:shelf_id>/<int:book_id>"
)
...
...
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