18 lines
583 B
Python
18 lines
583 B
Python
import frappe
|
|
from ...lms.doctype.lms_sketch.lms_sketch import get_recent_sketches
|
|
|
|
def get_context(context):
|
|
context.no_cache = 1
|
|
context.username = frappe.form_dict["username"]
|
|
context.member = get_member(context.username)
|
|
if not context.member:
|
|
context.template = "www/404.html"
|
|
else:
|
|
context.sketches = list(filter(lambda x: x.owner == context.member.email, get_recent_sketches()))
|
|
|
|
def get_member(username):
|
|
try:
|
|
return frappe.get_doc("Community Member", {"username":username})
|
|
except frappe.DoesNotExistError:
|
|
return
|