diff --git a/documentation/zensical.toml b/documentation/zensical.toml index e5f38ff24..1e9c42188 100644 --- a/documentation/zensical.toml +++ b/documentation/zensical.toml @@ -39,6 +39,7 @@ nav = [ ]} ]}, {"Developers" = [ + {"Codabench Basic Installation Guide" = "Developers_and_Administrators/Codabench-Installation.md"}, {"Codabench Docker Architecture" = "Developers_and_Administrators/Codabench-Architecture.md"}, {"Submission Docker Container Layout" = "Developers_and_Administrators/Submission-Docker-Container-Layout.md"}, {"Submission Process Overview" = "Developers_and_Administrators/Submission-Process-Overview.md"}, @@ -49,7 +50,6 @@ nav = [ ]}, {"Self-Hosters" = [ - {"Codabench Basic Installation Guide" = "Developers_and_Administrators/Codabench-Installation.md"}, {"How to Deploy a Server" = "Developers_and_Administrators/How-to-deploy-Codabench-on-your-server.md"}, {"Administrative Procedures" = "Developers_and_Administrators/Administrator-procedures.md"}, {"Backups - Automating Creation and Restoring" = "Developers_and_Administrators/Creating-and-Restoring-from-Backup.md"}, diff --git a/src/apps/competitions/models.py b/src/apps/competitions/models.py index e5facb4fc..f919ae432 100644 --- a/src/apps/competitions/models.py +++ b/src/apps/competitions/models.py @@ -536,9 +536,10 @@ def soft_delete(self): detail.delete() # Remove record from DB # Clear the data field if no other submissions are using it - other_submissions_using_data = Submission.objects.filter(data=self.data).exclude(pk=self.pk).exists() - if not other_submissions_using_data: - self.data.delete() + if self.data: + other_submissions_using_data = Submission.objects.filter(data=self.data).exclude(pk=self.pk).exists() + if not other_submissions_using_data: + self.data.delete() # Clear the data field for this submission self.data = None @@ -554,11 +555,12 @@ def soft_delete(self): def delete(self, **kwargs): # Check if any other submissions are using the same data - other_submissions_using_data = Submission.objects.filter(data=self.data).exclude(pk=self.pk).exists() + if self.data: + other_submissions_using_data = Submission.objects.filter(data=self.data).exclude(pk=self.pk).exists() - if not other_submissions_using_data: - # If no other submissions are using the same data, delete it - self.data.delete() + if not other_submissions_using_data: + # If no other submissions are using the same data, delete it + self.data.delete() # Also clean up details on delete self.details.all().delete() diff --git a/src/apps/profiles/views.py b/src/apps/profiles/views.py index 81c8dc1de..161fd5ffe 100644 --- a/src/apps/profiles/views.py +++ b/src/apps/profiles/views.py @@ -290,7 +290,7 @@ def log_in(request): try: user = User.objects.get((Q(username=username) | Q(email=username)) & Q(is_deleted=False)) except User.DoesNotExist: - messages.error(request, "User does not exist!") + messages.error(request, "Invalid login/password") else: # Authenticate user with credentials user = authenticate(username=username, password=password) @@ -307,7 +307,7 @@ def log_in(request): else: context['activation_error'] = "Your account is not activated. Please check your email for the activation link" else: - messages.error(request, "Wrong Credentials!") + messages.error(request, "Invalid login/password") else: context['form'] = form diff --git a/src/settings/base.py b/src/settings/base.py index d2698bb2a..3f39a2448 100644 --- a/src/settings/base.py +++ b/src/settings/base.py @@ -92,7 +92,6 @@ 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', # 'corsheaders.middleware.CorsMiddleware', # BB - 'django.middleware.common.CommonMiddleware', 'middleware.BlockBannedUsersMiddleware' ) diff --git a/src/static/riot/competitions/detail/submission_manager.tag b/src/static/riot/competitions/detail/submission_manager.tag index 441a6cf52..3f41a69eb 100644 --- a/src/static/riot/competitions/detail/submission_manager.tag +++ b/src/static/riot/competitions/detail/submission_manager.tag @@ -123,8 +123,15 @@ - - + + + + + + + +