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
af8d908b
Commit
af8d908b
authored
Nov 01, 2017
by
OzzieIsaacs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix #371, #372
parent
ae1e7c57
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
ub.py
cps/ub.py
+1
-1
web.py
cps/web.py
+2
-2
No files found.
cps/ub.py
View file @
af8d908b
...
...
@@ -153,7 +153,7 @@ class User(UserBase, Base):
role
=
Column
(
SmallInteger
,
default
=
ROLE_USER
)
password
=
Column
(
String
)
kindle_mail
=
Column
(
String
(
120
),
default
=
""
)
shelf
=
relationship
(
'Shelf'
,
backref
=
'user'
,
lazy
=
'dynamic'
)
shelf
=
relationship
(
'Shelf'
,
backref
=
'user'
,
lazy
=
'dynamic'
,
order_by
=
'Shelf.name'
)
downloads
=
relationship
(
'Downloads'
,
backref
=
'user'
,
lazy
=
'dynamic'
)
locale
=
Column
(
String
(
2
),
default
=
"en"
)
sidebar_view
=
Column
(
Integer
,
default
=
1
)
...
...
cps/web.py
View file @
af8d908b
...
...
@@ -623,7 +623,7 @@ def before_request():
g
.
user
=
current_user
g
.
allow_registration
=
config
.
config_public_reg
g
.
allow_upload
=
config
.
config_uploading
g
.
public_shelfes
=
ub
.
session
.
query
(
ub
.
Shelf
)
.
filter
(
ub
.
Shelf
.
is_public
==
1
)
.
all
()
g
.
public_shelfes
=
ub
.
session
.
query
(
ub
.
Shelf
)
.
filter
(
ub
.
Shelf
.
is_public
==
1
)
.
order_by
(
ub
.
Shelf
.
name
)
.
all
()
if
not
config
.
db_configured
and
request
.
endpoint
not
in
(
'basic_configuration'
,
'login'
)
and
'/static/'
not
in
request
.
path
:
return
redirect
(
url_for
(
'basic_configuration'
))
...
...
@@ -1250,7 +1250,7 @@ def language(name, page):
@
login_required_if_no_ano
def
category_list
():
entries
=
db
.
session
.
query
(
db
.
Tags
,
func
.
count
(
'books_tags_link.book'
)
.
label
(
'count'
))
\
.
join
(
db
.
books_tags_link
)
.
join
(
db
.
Books
)
.
filter
(
common_filters
())
\
.
join
(
db
.
books_tags_link
)
.
join
(
db
.
Books
)
.
order_by
(
db
.
Tags
.
name
)
.
filter
(
common_filters
())
\
.
group_by
(
'books_tags_link.tag'
)
.
all
()
return
render_title_template
(
'list.html'
,
entries
=
entries
,
folder
=
'category'
,
title
=
_
(
u"Category list"
))
...
...
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