mirror of
https://github.com/retspen/webvirtcloud
synced 2024-12-24 23:25:24 +00:00
integer_validator causes import problem. it removed
This commit is contained in:
parent
c355a4014f
commit
858d1f87d5
1 changed files with 5 additions and 5 deletions
|
@ -2,7 +2,7 @@ from django.db import models
|
||||||
from django.contrib.auth.models import User
|
from django.contrib.auth.models import User
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from instances.models import Instance
|
from instances.models import Instance
|
||||||
from django.core.validators import integer_validator, MinValueValidator
|
from django.core.validators import MinValueValidator
|
||||||
|
|
||||||
|
|
||||||
class UserInstance(models.Model):
|
class UserInstance(models.Model):
|
||||||
|
@ -27,10 +27,10 @@ class UserSSHKey(models.Model):
|
||||||
class UserAttributes(models.Model):
|
class UserAttributes(models.Model):
|
||||||
user = models.OneToOneField(User, on_delete=models.CASCADE)
|
user = models.OneToOneField(User, on_delete=models.CASCADE)
|
||||||
can_clone_instances = models.BooleanField(default=True)
|
can_clone_instances = models.BooleanField(default=True)
|
||||||
max_instances = models.IntegerField(default=1, help_text="-1 for unlimited. Any integer value", validators=[integer_validator,MinValueValidator(-1),])
|
max_instances = models.IntegerField(default=1, help_text="-1 for unlimited. Any integer value", validators=[MinValueValidator(-1),])
|
||||||
max_cpus = models.IntegerField(default=1, help_text="-1 for unlimited. Any integer value", validators=[integer_validator,MinValueValidator(-1)])
|
max_cpus = models.IntegerField(default=1, help_text="-1 for unlimited. Any integer value", validators=[MinValueValidator(-1)])
|
||||||
max_memory = models.IntegerField(default=2048, help_text="-1 for unlimited. Any integer value", validators=[integer_validator,MinValueValidator(-1)])
|
max_memory = models.IntegerField(default=2048, help_text="-1 for unlimited. Any integer value", validators=[MinValueValidator(-1)])
|
||||||
max_disk_size = models.IntegerField(default=20, help_text="-1 for unlimited. Any integer value", validators=[integer_validator,MinValueValidator(-1)])
|
max_disk_size = models.IntegerField(default=20, help_text="-1 for unlimited. Any integer value", validators=[MinValueValidator(-1)])
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def create_missing_userattributes(user):
|
def create_missing_userattributes(user):
|
||||||
|
|
Loading…
Reference in a new issue