问题 Context I have the models AppVersion , App & DeployApp . In the AppVersion model users can upload APK files to the filesystem. I am using a pre_save signal to prevent uploading APK files with the same version_code for a specific App like this: @receiver(pre_save, sender=AppVersion) def prevent_duplicate_version_code(sender, instance, **kwargs): qs = AppVersion.objects.filter(app_uuid=instance.app_uuid, version_code=instance.version_code) if qs.exists(): raise FileExistsError("Version code has