refactor: patches to fix data, profile dashboard, lms mentor mapping page fixes

This commit is contained in:
pateljannat
2021-05-21 21:40:31 +05:30
parent 637c795321
commit 713dcf178a
23 changed files with 314 additions and 386 deletions

View File

@@ -3,15 +3,9 @@ from community.lms.models import Sketch
def get_context(context):
context.no_cache = 1
context.username = frappe.form_dict["username"]
context.member = get_member(context.username)
if not context.member:
try:
context.member = frappe.get_doc("User", {"username": frappe.form_dict["username"]})
except:
context.template = "www/404.html"
else:
context.sketches = Sketch.get_recent_sketches(owner=context.member.email)
def get_member(username):
try:
return frappe.get_doc("Community Member", {"username":username})
except frappe.DoesNotExistError:
return