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
5b67b687
Commit
5b67b687
authored
Oct 13, 2020
by
Ozzieisaacs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed remaining code from view downloaded books in user section
Fixes for #1661
parent
d128b037
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
13 deletions
+3
-13
admin.py
cps/admin.py
+3
-13
No files found.
cps/admin.py
View file @
5b67b687
...
...
@@ -799,7 +799,7 @@ def _handle_new_user(to_save, content,languages, translations, kobo_support):
flash
(
_
(
u"Settings DB is not Writeable"
),
category
=
"error"
)
def
_handle_edit_user
(
to_save
,
content
,
languages
,
translations
,
kobo_support
,
downloads
):
def
_handle_edit_user
(
to_save
,
content
,
languages
,
translations
,
kobo_support
):
if
"delete"
in
to_save
:
if
ub
.
session
.
query
(
ub
.
User
)
.
filter
(
ub
.
User
.
role
.
op
(
'&'
)(
constants
.
ROLE_ADMIN
)
==
constants
.
ROLE_ADMIN
,
ub
.
User
.
id
!=
content
.
id
)
.
count
():
...
...
@@ -858,7 +858,6 @@ def _handle_edit_user(to_save, content,languages, translations, kobo_support, do
kobo_support
=
kobo_support
,
new_user
=
0
,
content
=
content
,
downloads
=
downloads
,
registered_oauth
=
oauth_check
,
title
=
_
(
u"Edit User
%(nick)
s"
,
nick
=
content
.
nickname
),
page
=
"edituser"
)
if
"nickname"
in
to_save
and
to_save
[
"nickname"
]
!=
content
.
nickname
:
...
...
@@ -872,7 +871,6 @@ def _handle_edit_user(to_save, content,languages, translations, kobo_support, do
languages
=
languages
,
mail_configured
=
config
.
get_mail_server_configured
(),
new_user
=
0
,
content
=
content
,
downloads
=
downloads
,
registered_oauth
=
oauth_check
,
kobo_support
=
kobo_support
,
title
=
_
(
u"Edit User
%(nick)
s"
,
nick
=
content
.
nickname
),
...
...
@@ -961,28 +959,20 @@ def update_mailsettings():
@
admin_required
def
edit_user
(
user_id
):
content
=
ub
.
session
.
query
(
ub
.
User
)
.
filter
(
ub
.
User
.
id
==
int
(
user_id
))
.
first
()
# type: ub.User
if
not
content
:
if
not
content
or
(
not
config
.
config_anonbrowse
and
content
.
nickname
==
"Guest"
)
:
flash
(
_
(
u"User not found"
),
category
=
"error"
)
return
redirect
(
url_for
(
'admin.admin'
))
downloads
=
list
()
languages
=
calibre_db
.
speaking_language
()
translations
=
babel
.
list_translations
()
+
[
LC
(
'en'
)]
kobo_support
=
feature_support
[
'kobo'
]
and
config
.
config_kobo_sync
for
book
in
content
.
downloads
:
downloadbook
=
calibre_db
.
get_book
(
book
.
book_id
)
if
downloadbook
:
downloads
.
append
(
downloadbook
)
else
:
ub
.
delete_download
(
book
.
book_id
)
if
request
.
method
==
"POST"
:
to_save
=
request
.
form
.
to_dict
()
_handle_edit_user
(
to_save
,
content
,
languages
,
translations
,
kobo_support
,
downloads
)
_handle_edit_user
(
to_save
,
content
,
languages
,
translations
,
kobo_support
)
return
render_title_template
(
"user_edit.html"
,
translations
=
translations
,
languages
=
languages
,
new_user
=
0
,
content
=
content
,
downloads
=
downloads
,
registered_oauth
=
oauth_check
,
mail_configured
=
config
.
get_mail_server_configured
(),
kobo_support
=
kobo_support
,
...
...
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