summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSean Smith <ssmith@iol.unh.edu>2020-07-28 10:03:15 -0400
committerSean Smith <ssmith@iol.unh.edu>2020-07-28 11:37:13 -0400
commit6e6ba0ab166accc0416de209043bbcc0bc84ec69 (patch)
tree82fea742f0a80da8a03d2e8e6d1fc97c0660d28b
parent0d90af7bcea705c78df92336b31836ef67cd5d10 (diff)
Allow Null Values in Admin Interface
Signed-off-by: Sean Smith <ssmith@iol.unh.edu> Change-Id: I6f3213ea47073ef4427a1f301ac6340e848e0891
-rw-r--r--src/booking/models.py6
-rw-r--r--src/resource_inventory/models.py2
2 files changed, 4 insertions, 4 deletions
diff --git a/src/booking/models.py b/src/booking/models.py
index cf8bf1d..cfdf7bc 100644
--- a/src/booking/models.py
+++ b/src/booking/models.py
@@ -21,7 +21,7 @@ class Booking(models.Model):
# All bookings are owned by the user who requested it
owner = models.ForeignKey(User, on_delete=models.PROTECT, related_name='owner')
# an owner can add other users to the booking
- collaborators = models.ManyToManyField(User, related_name='collaborators')
+ collaborators = models.ManyToManyField(User, blank=True, related_name='collaborators')
# start and end time
start = models.DateTimeField()
end = models.DateTimeField()
@@ -32,8 +32,8 @@ class Booking(models.Model):
# bookings can be extended a limited number of times
ext_count = models.IntegerField(default=2)
# the hardware that the user has booked
- resource = models.ForeignKey(ResourceBundle, on_delete=models.SET_NULL, null=True)
- opnfv_config = models.ForeignKey(OPNFVConfig, on_delete=models.SET_NULL, null=True)
+ resource = models.ForeignKey(ResourceBundle, on_delete=models.SET_NULL, null=True, blank=True)
+ opnfv_config = models.ForeignKey(OPNFVConfig, on_delete=models.SET_NULL, null=True, blank=True)
project = models.CharField(max_length=100, default="", blank=True, null=True)
lab = models.ForeignKey(Lab, null=True, on_delete=models.SET_NULL)
pdf = models.TextField(blank=True, default="")
diff --git a/src/resource_inventory/models.py b/src/resource_inventory/models.py
index 4a6375d..7a1f259 100644
--- a/src/resource_inventory/models.py
+++ b/src/resource_inventory/models.py
@@ -122,7 +122,7 @@ class CpuProfile(models.Model):
])
cpus = models.IntegerField()
host = models.ForeignKey(ResourceProfile, on_delete=models.CASCADE, related_name='cpuprofile')
- cflags = models.TextField(null=True)
+ cflags = models.TextField(null=True, blank=True)
def __str__(self):
return str(self.architecture) + " " + str(self.cpus) + "S" + str(self.cores) + " C for " + str(self.host)