mirror of
https://github.com/janeczku/calibre-web
synced 2024-12-25 09:30:31 +00:00
oauth problem solved
This commit is contained in:
parent
d89830af61
commit
61d628d596
11
cps/web.py
11
cps/web.py
@ -1658,9 +1658,10 @@ def profile():
|
||||
kobo_support = feature_support['kobo'] and config.config_kobo_sync
|
||||
if feature_support['oauth'] and config.config_login_type == 2:
|
||||
oauth_status = get_oauth_status()
|
||||
local_oauth_check = oauth_check
|
||||
else:
|
||||
oauth_status = None
|
||||
oauth_check = {}
|
||||
local_oauth_check = {}
|
||||
|
||||
for book in current_user.downloads:
|
||||
downloadBook = calibre_db.get_book(book.book_id)
|
||||
@ -1684,7 +1685,7 @@ def profile():
|
||||
return render_title_template("user_edit.html", content=current_user, downloads=downloads,
|
||||
title=_(u"%(name)s's profile", name=current_user.nickname), page="me",
|
||||
kobo_support=kobo_support,
|
||||
registered_oauth=oauth_check, oauth_status=oauth_status)
|
||||
registered_oauth=local_oauth_check, oauth_status=oauth_status)
|
||||
if "nickname" in to_save and to_save["nickname"] != current_user.nickname:
|
||||
# Query User nickname, if not existing, change
|
||||
if not ub.session.query(ub.User).filter(ub.User.nickname == to_save["nickname"]).scalar():
|
||||
@ -1697,7 +1698,7 @@ def profile():
|
||||
kobo_support=kobo_support,
|
||||
new_user=0, content=current_user,
|
||||
downloads=downloads,
|
||||
registered_oauth=oauth_check,
|
||||
registered_oauth=local_oauth_check,
|
||||
title=_(u"Edit User %(nick)s",
|
||||
nick=current_user.nickname),
|
||||
page="edituser")
|
||||
@ -1728,13 +1729,13 @@ def profile():
|
||||
return render_title_template("user_edit.html", content=current_user, downloads=downloads,
|
||||
translations=translations, kobo_support=kobo_support,
|
||||
title=_(u"%(name)s's profile", name=current_user.nickname), page="me",
|
||||
registered_oauth=oauth_check, oauth_status=oauth_status)
|
||||
registered_oauth=local_oauth_check, oauth_status=oauth_status)
|
||||
flash(_(u"Profile updated"), category="success")
|
||||
log.debug(u"Profile updated")
|
||||
return render_title_template("user_edit.html", translations=translations, profile=1, languages=languages,
|
||||
content=current_user, downloads=downloads, kobo_support=kobo_support,
|
||||
title=_(u"%(name)s's profile", name=current_user.nickname),
|
||||
page="me", registered_oauth=oauth_check, oauth_status=oauth_status)
|
||||
page="me", registered_oauth=local_oauth_check, oauth_status=oauth_status)
|
||||
|
||||
|
||||
# ###################################Show single book ##################################################################
|
||||
|
Loading…
Reference in New Issue
Block a user