fix: profile and progress on dashboard

This commit is contained in:
pateljannat
2021-09-01 16:21:55 +05:30
parent cd4ffa2eff
commit 13b968e18c
19 changed files with 126 additions and 49 deletions

View File

@@ -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