'Updates or creates the BlockStructureModel entry
for the given data_usage_key in the kwargs,
uploading serialized_data as the content data.'

@classmethod
def update_or_create(cls, serialized_data, data_usage_key, **kwargs):

    with transaction.atomic():
        (bs_model, created) = cls.objects.update_or_create(defaults=kwargs, data_usage_key=data_usage_key)
        operation = (u'Created' if created else u'Updated')
        with _storage_error_handling(bs_model, operation):
            bs_model.data.save('', ContentFile(serialized_data))
    cls._log(bs_model, operation, serialized_data)
    if (not created):
        cls._prune_files(data_usage_key)
    return (bs_model, created)
