|
|
@ -1658,9 +1658,10 @@ def profile():
|
|
|
|
kobo_support = feature_support['kobo'] and config.config_kobo_sync
|
|
|
|
kobo_support = feature_support['kobo'] and config.config_kobo_sync
|
|
|
|
if feature_support['oauth'] and config.config_login_type == 2:
|
|
|
|
if feature_support['oauth'] and config.config_login_type == 2:
|
|
|
|
oauth_status = get_oauth_status()
|
|
|
|
oauth_status = get_oauth_status()
|
|
|
|
|
|
|
|
local_oauth_check = oauth_check
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
oauth_status = None
|
|
|
|
oauth_status = None
|
|
|
|
oauth_check = {}
|
|
|
|
local_oauth_check = {}
|
|
|
|
|
|
|
|
|
|
|
|
for book in current_user.downloads:
|
|
|
|
for book in current_user.downloads:
|
|
|
|
downloadBook = calibre_db.get_book(book.book_id)
|
|
|
|
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,
|
|
|
|
return render_title_template("user_edit.html", content=current_user, downloads=downloads,
|
|
|
|
title=_(u"%(name)s's profile", name=current_user.nickname), page="me",
|
|
|
|
title=_(u"%(name)s's profile", name=current_user.nickname), page="me",
|
|
|
|
kobo_support=kobo_support,
|
|
|
|
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:
|
|
|
|
if "nickname" in to_save and to_save["nickname"] != current_user.nickname:
|
|
|
|
# Query User nickname, if not existing, change
|
|
|
|
# Query User nickname, if not existing, change
|
|
|
|
if not ub.session.query(ub.User).filter(ub.User.nickname == to_save["nickname"]).scalar():
|
|
|
|
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,
|
|
|
|
kobo_support=kobo_support,
|
|
|
|
new_user=0, content=current_user,
|
|
|
|
new_user=0, content=current_user,
|
|
|
|
downloads=downloads,
|
|
|
|
downloads=downloads,
|
|
|
|
registered_oauth=oauth_check,
|
|
|
|
registered_oauth=local_oauth_check,
|
|
|
|
title=_(u"Edit User %(nick)s",
|
|
|
|
title=_(u"Edit User %(nick)s",
|
|
|
|
nick=current_user.nickname),
|
|
|
|
nick=current_user.nickname),
|
|
|
|
page="edituser")
|
|
|
|
page="edituser")
|
|
|
@ -1728,13 +1729,13 @@ def profile():
|
|
|
|
return render_title_template("user_edit.html", content=current_user, downloads=downloads,
|
|
|
|
return render_title_template("user_edit.html", content=current_user, downloads=downloads,
|
|
|
|
translations=translations, kobo_support=kobo_support,
|
|
|
|
translations=translations, kobo_support=kobo_support,
|
|
|
|
title=_(u"%(name)s's profile", name=current_user.nickname), page="me",
|
|
|
|
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")
|
|
|
|
flash(_(u"Profile updated"), category="success")
|
|
|
|
log.debug(u"Profile updated")
|
|
|
|
log.debug(u"Profile updated")
|
|
|
|
return render_title_template("user_edit.html", translations=translations, profile=1, languages=languages,
|
|
|
|
return render_title_template("user_edit.html", translations=translations, profile=1, languages=languages,
|
|
|
|
content=current_user, downloads=downloads, kobo_support=kobo_support,
|
|
|
|
content=current_user, downloads=downloads, kobo_support=kobo_support,
|
|
|
|
title=_(u"%(name)s's profile", name=current_user.nickname),
|
|
|
|
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 ##################################################################
|
|
|
|
# ###################################Show single book ##################################################################
|
|
|
|