From dee5a8575d3692e3dfc21a40f62d007ff0df440c Mon Sep 17 00:00:00 2001 From: Stefano Alberto Russo <stefano.russo@gmail.com> Date: Tue, 19 May 2020 18:14:06 +0200 Subject: [PATCH] Minor fixes in model fields attributes and the populate script. --- .../core_app/management/commands/core_app_populate.py | 10 +++++----- services/webapp/code/rosetta/core_app/models.py | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/services/webapp/code/rosetta/core_app/management/commands/core_app_populate.py b/services/webapp/code/rosetta/core_app/management/commands/core_app_populate.py index 126b4b9..8cdf534 100644 --- a/services/webapp/code/rosetta/core_app/management/commands/core_app_populate.py +++ b/services/webapp/code/rosetta/core_app/management/commands/core_app_populate.py @@ -58,7 +58,7 @@ class Command(BaseCommand): supports_user_auth = False, supports_pass_auth = True) - # BasicMetaDesktop Singularity (sarusso repo) + # BasicMetaDesktop Docker (sarusso repo) Container.objects.create(user = None, name = 'BasicMetaDesktop latest', image = 'sarusso/basicmetadesktop', @@ -70,11 +70,11 @@ class Command(BaseCommand): supports_pass_auth = True) - # DevMetaDesktop Singularity (sarusso repo) + # DevMetaDesktop Docker (sarusso repo) Container.objects.create(user = None, name = 'DevMetaDesktop latest', image = 'sarusso/devmetadesktop', - type = 'singularity', + type = 'docker', registry = 'docker_hub', ports = '8590', supports_dynamic_ports = True, @@ -150,7 +150,7 @@ class Command(BaseCommand): else: print('Creating testuser private containers...') - # JuPyter Singularity + # Jupyter Singularity Container.objects.create(user = testuser, name = 'Jupyter Notebook latest', image = 'jupyter/base-notebook', @@ -161,7 +161,7 @@ class Command(BaseCommand): supports_user_auth = False, supports_pass_auth = False) - # JuPyter Docker + # Jupyter Docker Container.objects.create(user = testuser, name = 'Jupyter Notebook latest', image = 'jupyter/base-notebook', diff --git a/services/webapp/code/rosetta/core_app/models.py b/services/webapp/code/rosetta/core_app/models.py index ab0911a..6d4da2e 100644 --- a/services/webapp/code/rosetta/core_app/models.py +++ b/services/webapp/code/rosetta/core_app/models.py @@ -74,7 +74,7 @@ class LoginToken(models.Model): class Container(models.Model): uuid = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False) - user = models.ForeignKey(User, related_name='+', on_delete=models.CASCADE, null=True) + user = models.ForeignKey(User, related_name='+', on_delete=models.CASCADE, blank=True, null=True) # If a container has no user, it will be available to anyone. Can be created, edited and deleted only by admins. name = models.CharField('Container Name', max_length=255, blank=False, null=False) -- GitLab