@frappe.whitelist()
def get_usage_info():
 from frappe.email.queue import get_emails_sent_this_month
 limits = get_limits()
 if (not (limits and any([limits.users, limits.space, limits.emails, limits.expiry]))):
  return
 limits.space = ((limits.space or 0) * 1024.0)
 if (not limits.space_usage):
  limits.space_usage = {u'database_size': 26, u'files_size': 1, u'backup_size': 1, u'total': 28}
 usage_info = frappe._dict({u'limits': limits, u'enabled_users': len(get_enabled_system_users()), u'emails_sent': get_emails_sent_this_month(), u'space_usage': limits.space_usage[u'total']})
 if limits.expiry:
  usage_info[u'expires_on'] = formatdate(limits.expiry)
  usage_info[u'days_to_expiry'] = (getdate(limits.expiry) - getdate()).days
 if limits.upgrade_url:
  usage_info[u'upgrade_url'] = get_upgrade_url(limits.upgrade_url)
 return usage_info

@ frappe . whitelist ( ) def get_usage_info ( ) : from frappe . email . queue import get_emails_sent_this_month limits = get_limits ( ) if ( not ( limits and any ( [ limits . users , limits . space , limits . emails , limits . expiry ] ) ) ) : return limits . space = ( ( limits . space or 0 ) * 1024.0 ) if ( not limits . space_usage ) : limits . space_usage = { u'database_size' : 26 , u'files_size' : 1 , u'backup_size' : 1 , u'total' : 28 } usage_info = frappe . _dict ( { u'limits' : limits , u'enabled_users' : len ( get_enabled_system_users ( ) ) , u'emails_sent' : get_emails_sent_this_month ( ) , u'space_usage' : limits . space_usage [ u'total' ] } ) if limits . expiry : usage_info [ u'expires_on' ] = formatdate ( limits . expiry ) usage_info [ u'days_to_expiry' ] = ( getdate ( limits . expiry ) - getdate ( ) ) . days if limits . upgrade_url : usage_info [ u'upgrade_url' ] = get_upgrade_url ( limits . upgrade_url ) return usage_info
get data to show for usage info .