Revision b10aa469 snf-cyclades-app/synnefo/api/networks.py

b/snf-cyclades-app/synnefo/api/networks.py
182 182
    if net_type not in settings.ENABLED_NETWORKS:
183 183
        raise Forbidden("Can not create %s network" % net_type)
184 184

  
185
    networks_user_limit = \
186
        settings.NETWORKS_USER_QUOTA.get(request.user_uniq,
187
                                         settings.MAX_NETWORKS_PER_USER)
188

  
185 189
    user_networks = len(Network.objects.filter(userid=request.user_uniq,
186 190
                                               deleted=False))
187 191

  
188
    if user_networks >= settings.MAX_NETWORKS_PER_USER:
192
    if user_networks >= networks_user_limit:
189 193
        raise OverLimit('Network count limit exceeded for your account.')
190 194

  
191 195
    cidr_block = int(subnet.split('/')[1])

Also available in: Unified diff