Revision cbf7b384 snf-cyclades-app/synnefo/ui/views.py

b/snf-cyclades-app/synnefo/ui/views.py
218 218
               'machine': machine, 'host_ip': host_ip, 'host_ip_v6': host_ip_v6}
219 219
    return template('machines_console', request, context)
220 220

  
221
def user_quota(request):
222
    get_user(request, settings.ASTAKOS_URL)
223
    vms_limit_for_user = \
224
        settings.VMS_USER_QUOTA.get(request.user_uniq,
225
                settings.MAX_VMS_PER_USER)
226

  
227
    networks_limit_for_user = \
228
        settings.NETWORKS_USER_QUOTA.get(request.user_uniq,
229
                settings.MAX_NETWORKS_PER_USER)
230
    return HttpResponse('{"vms_quota":%d, "networks_quota":%d}' % (vms_limit_for_user,
231
                                                               networks_limit_for_user),
232
                        mimetype="application/json")
233

  
221 234
def js_tests(request):
222 235
    return template('tests', request, {})
223 236

  

Also available in: Unified diff