@contextfunction
def user_block(context):
 request = context['request']
 user = request.user.profile
 modules = user.get_perspective().get_modules()
 account = modules.filter(name='treeio.account')
 admin = modules.filter(name='treeio.core')
 if admin:
  admin = admin[0]
 response_format = 'html'
 if ('response_format' in context):
  response_format = context['response_format']
 trial = False
 if (getattr(settings, 'HARDTREE_SUBSCRIPTION_USER_LIMIT') == 3):
  trial = True
 active = context.get('active', None)
 return Markup(render_to_string('core/tags/user_block', {'user': user, 'account': account, 'admin': admin, 'active': active, 'trial': trial}, response_format=response_format))

@ contextfunction def user_block ( context ) : request = context [ 'request' ] user = request . user . profile modules = user . get_perspective ( ) . get_modules ( ) account = modules . filter ( name = 'treeio.account' ) admin = modules . filter ( name = 'treeio.core' ) if admin : admin = admin [ 0 ] response_format = 'html' if ( 'response_format' in context ) : response_format = context [ 'response_format' ] trial = False if ( getattr ( settings , 'HARDTREE_SUBSCRIPTION_USER_LIMIT' ) == 3 ) : trial = True active = context . get ( 'active' , None ) return Markup ( render_to_string ( 'core/tags/user_block' , { 'user' : user , 'account' : account , 'admin' : admin , 'active' : active , 'trial' : trial } , response_format = response_format ) )
user block .