fix: course card buttons

This commit is contained in:
Jan Doe
2021-09-10 18:54:27 +05:30
parent 7721f31342
commit 56d738474a
3 changed files with 124 additions and 86 deletions

View File

@@ -1,4 +1,5 @@
import frappe
from community.page_renderers import get_profile_url_prefix
def get_context(context):
context.no_cache = 1
@@ -8,7 +9,7 @@ def get_context(context):
except KeyError:
username = frappe.db.get_value("User", frappe.session.user, ["username"])
if username:
frappe.local.flags.redirect_location = "/users/" + username
frappe.local.flags.redirect_location = get_profile_url_prefix() + username
raise frappe.Redirect
try:
context.member = frappe.get_doc("User", {"username": username})