This commit is contained in:
j3d1 2026-08-16 19:00:05 +02:00
parent 82a27ce2a8
commit 3b494dfa37
8 changed files with 112 additions and 10 deletions

View file

@ -130,7 +130,8 @@ def getUserInfo(request):
return Response({'profile_picture_id': 'File does not exist.'}, status=400)
user.save()
if old_file and old_file != user.profile_picture and old_file.connected_items.count() == 0 and old_file.profile_picture_users.count() == 0:
if old_file and old_file != user.profile_picture and old_file.connected_items.count() == 0 \
and old_file.profile_picture_users.count() == 0 and old_file.staged_by_workflows.count() == 0:
old_file.delete()
return Response({