Files
lms/community/www/profiles/profile.py
Anand Chitipothu 524a041fb9 fix: error on profile page
Profile page was importing Sketch which was removed recently, even
though it was not using that. Removed it to fix the issue.
2021-07-08 10:33:12 +05:30

22 lines
603 B
Python

import frappe
def get_context(context):
context.no_cache = 1
try:
context.member = frappe.get_doc("User", {"username": frappe.form_dict["username"]})
except:
context.template = "www/404.html"
return
context.profile_tabs = get_profile_tabs(context.member)
def get_profile_tabs(user):
"""Returns the enabled ProfileTab objects.
Each ProfileTab is rendered as a tab on the profile page and the
they are specified as profile_tabs hook.
"""
tabs = frappe.get_hooks("profile_tabs") or []
return [frappe.get_attr(tab)(user) for tab in tabs]