Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion documentation/zensical.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"},
Expand All @@ -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"},
Expand Down
16 changes: 9 additions & 7 deletions src/apps/competitions/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions src/apps/profiles/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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

Expand Down
11 changes: 9 additions & 2 deletions src/static/riot/competitions/detail/submission_manager.tag
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,15 @@
</a>
</td>
<!-- Show Action buttons when submission is not soft deleted -->
<!-- Otherwise show empty <td> -->
<td if="{ submission.is_soft_deleted }"></td>
<!-- For soft-deleted submissions, organizers can still hard-delete -->
<td if="{ submission.is_soft_deleted }">
<virtual if="{ opts.admin }">
<span data-tooltip="Delete Submission" data-inverted=""
onclick="{ delete_submission.bind(this, submission) }">
<i class="icon red trash alternate"></i>
</span>
</virtual>
</td>
<td class="center aligned" if="{ !submission.is_soft_deleted }">
<virtual if="{ opts.admin}">
<!-- run/rerun submission -->
Expand Down
Loading