Commit 4b620db0 by tarokkk

one: Added quota cehck, school added owned shares

parent 2dea86ba
......@@ -210,6 +210,8 @@ def vm_new(request, template=None, share=None):
t.save()
base = t
try:
#Gány quota
if share == None or (share != None and share.get_running() < share.instance_limit):
i = Instance.submit(base, request.user, extra="<RECONTEXT>YES</RECONTEXT>", share=share)
return redirect(i)
except Exception as e:
......
......@@ -29,6 +29,9 @@ class Person(models.Model):
choices=LANGUAGE_CHOICES, default=LANGUAGE_CODE)
code = models.CharField(_('code'), max_length=30, unique=True)
def get_owned_shares(self):
return one.models.Share.objects.filter(group__in=self.owned_groups.all())
def get_shares(self):
return one.models.Share.objects.filter(group__in=self.course_groups.all())
......
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 sign in to comment