fix: profile and progress on dashboard
This commit is contained in:
@@ -4,7 +4,14 @@ def get_context(context):
|
||||
context.no_cache = 1
|
||||
|
||||
try:
|
||||
context.member = frappe.get_doc("User", {"username": frappe.form_dict["username"]})
|
||||
username = frappe.form_dict["username"]
|
||||
except KeyError:
|
||||
username = frappe.db.get_value("User", frappe.session.user, ["username"])
|
||||
if username:
|
||||
frappe.local.flags.redirect_location = "/users/" + username
|
||||
raise frappe.Redirect
|
||||
try:
|
||||
context.member = frappe.get_doc("User", {"username": username})
|
||||
except:
|
||||
context.template = "www/404.html"
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user