Commit 01b9c358 authored by Giorgos Korfiatis's avatar Giorgos Korfiatis
Browse files

astakos: Remove obsolete fields of AstakosUserQuota

Remove quantity, import_limit, export_limit.
Update user-set-initial-quota management command.
parent c84353c7
......@@ -40,7 +40,6 @@ from collections import namedtuple
from django.core.management.base import BaseCommand, CommandError
from django.core.validators import validate_email
from synnefo.lib.quotaholder.api import QH_PRACTICALLY_INFINITE
from astakos.im.models import AstakosUser, AstakosUserQuota, Resource
......@@ -154,10 +153,8 @@ for a single user from the command line
if capacity == 'default':
try:
q = AstakosUserQuota.objects.get(
user=user,
resource__name=resource,
resource__name=name)
q = AstakosUserQuota.objects.get(user=user,
resource__name=resource)
q.delete()
except Exception as e:
import traceback
......
......@@ -447,7 +447,6 @@ class AstakosUser(User):
for p in policies:
p.setdefault('resource', '')
p.setdefault('capacity', 0)
p.setdefault('quantity', 0)
p.setdefault('update', True)
self.add_resource_policy(**p)
......@@ -464,7 +463,7 @@ class AstakosUser(User):
else:
q = self.astakosuserquota_set
q.create(
resource=resource, capacity=capacity, quanity=quantity,
resource=resource, capacity=capacity,
)
def get_resource_policy(self, resource):
......@@ -975,9 +974,6 @@ class ExtendedManager(models.Manager):
class AstakosUserQuota(models.Model):
objects = ExtendedManager()
capacity = intDecimalField()
quantity = intDecimalField(default=0)
export_limit = intDecimalField(default=QH_PRACTICALLY_INFINITE)
import_limit = intDecimalField(default=QH_PRACTICALLY_INFINITE)
resource = models.ForeignKey(Resource)
user = models.ForeignKey(AstakosUser)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment