Example #1
0
def delete_file(sender, instance, **kwargs):
    if sender == SourceFile or sender == ResourceVariant:
        if settings.AWS_ENABLED:
            try:
                s3.delete_file('source', instance.s3_path)
            except:
                logger.exception("Failed to delete S3 file")
        else:
            try:
                os.unlink(instance.local_filename)
            except OSError:
                pass
Example #2
0
def delete_file(sender, instance, **kwargs):
    if sender == SourceFile or sender == ResourceVariant:
        if settings.AWS_ENABLED:
            try:
                s3.delete_file('source', instance.s3_path)
            except:
                traceback.print_exc()
        else:
            try:
                os.unlink(instance.local_filename)
            except OSError:
                pass
Example #3
0
def delete_file(sender, instance, **kwargs):
    if sender == SourceFile or sender == ResourceVariant:
        if settings.AWS_ENABLED:
            try:
                s3.delete_file(instance.s3_path)
            except:
                traceback.print_exc()
        else:
            try:
                os.unlink(instance.local_filename)
            except OSError:
                pass
Example #4
0
def delete_file(sender, instance, **kwargs):
    if issubclass(sender, S3File):
        if settings.AWS_ENABLED:
            try:
                s3.delete_file(sender.bucket_name, instance.s3_path)
            except:
                logger.exception("Failed to delete S3 file")
        else:
            try:
                os.unlink(instance.local_filename)
            except OSError:
                pass
Example #5
0
def delete_file(sender, instance, **kwargs):
    if issubclass(sender, S3File):
        if settings.AWS_ENABLED:
            try:
                s3.delete_file(sender.bucket_name, instance.s3_path)
            except:
                logger.exception("Failed to delete S3 file")
        else:
            try:
                os.unlink(instance.local_filename)
            except OSError:
                pass