- installed a regex conveter to werkzeug to support regular expresions in routes - added a website route rule to match all profiles
19 lines
452 B
Python
19 lines
452 B
Python
import frappe
|
|
|
|
def get_context(context):
|
|
context.no_cache = 1
|
|
|
|
username = frappe.form_dict.get('username')
|
|
user = username and get_user(username)
|
|
if not user:
|
|
context.template = "www/404.html"
|
|
|
|
user.abbr = "".join([s[0] for s in user.full_name.split()])
|
|
context.user = user
|
|
|
|
def get_user(username):
|
|
try:
|
|
return frappe.get_doc("Community Member", username)
|
|
except frappe.DoesNotExistError:
|
|
return
|