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
0aa3ff4f
Commit
0aa3ff4f
authored
Nov 12, 2016
by
OzzieIsaacs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove trailing spaces from username during login
Upload of books working on windows without errors
parent
b86864b4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
helper.py
cps/helper.py
+4
-4
web.py
cps/web.py
+1
-1
No files found.
cps/helper.py
View file @
0aa3ff4f
...
...
@@ -192,20 +192,20 @@ def update_dir_stucture(book_id):
book
=
db
.
session
.
query
(
db
.
Books
)
.
filter
(
db
.
Books
.
id
==
book_id
)
.
first
()
path
=
os
.
path
.
join
(
config
.
DB_ROOT
,
book
.
path
)
authordir
=
book
.
path
.
split
(
"/"
)[
0
]
authordir
=
book
.
path
.
split
(
os
.
sep
)[
0
]
new_authordir
=
get_valid_filename
(
book
.
authors
[
0
]
.
name
,
False
)
titledir
=
book
.
path
.
split
(
"/"
)[
1
]
titledir
=
book
.
path
.
split
(
os
.
sep
)[
1
]
new_titledir
=
get_valid_filename
(
book
.
title
,
False
)
+
" ("
+
str
(
book_id
)
+
")"
if
titledir
!=
new_titledir
:
new_title_path
=
os
.
path
.
join
(
os
.
path
.
dirname
(
path
),
new_titledir
)
os
.
rename
(
path
,
new_title_path
)
path
=
new_title_path
book
.
path
=
book
.
path
.
split
(
"/"
)[
0
]
+
"/"
+
new_titledir
book
.
path
=
book
.
path
.
split
(
os
.
sep
)[
0
]
+
os
.
sep
+
new_titledir
if
authordir
!=
new_authordir
:
new_author_path
=
os
.
path
.
join
(
os
.
path
.
join
(
config
.
DB_ROOT
,
new_authordir
),
os
.
path
.
basename
(
path
))
os
.
renames
(
path
,
new_author_path
)
book
.
path
=
new_authordir
+
"/"
+
book
.
path
.
split
(
"/"
)[
1
]
book
.
path
=
new_authordir
+
os
.
sep
+
book
.
path
.
split
(
os
.
sep
)[
1
]
db
.
session
.
commit
()
cps/web.py
View file @
0aa3ff4f
...
...
@@ -983,7 +983,7 @@ def login():
if
request
.
method
==
"POST"
:
form
=
request
.
form
.
to_dict
()
user
=
ub
.
session
.
query
(
ub
.
User
)
.
filter
(
ub
.
User
.
nickname
==
form
[
'username'
])
.
first
()
user
=
ub
.
session
.
query
(
ub
.
User
)
.
filter
(
ub
.
User
.
nickname
==
form
[
'username'
]
.
strip
()
)
.
first
()
if
user
and
check_password_hash
(
user
.
password
,
form
[
'password'
]):
login_user
(
user
,
remember
=
True
)
...
...
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