renamed 'create'->'raw_create' and 'create_with_context'->'create'

This commit is contained in:
iLLiCiTiT 2023-01-28 00:33:33 +01:00
parent d09b781261
commit 430fe6aed4
2 changed files with 7 additions and 4 deletions

View file

@ -1407,8 +1407,8 @@ class CreateContext:
with self.bulk_instances_collection(): with self.bulk_instances_collection():
self._bulk_instances_to_process.append(instance) self._bulk_instances_to_process.append(instance)
def create(self, identifier, *args, **kwargs): def raw_create(self, identifier, *args, **kwargs):
"""Wrapper for creators to trigger created. """Wrapper for creators to trigger 'create' method.
Different types of creators may expect different arguments thus the Different types of creators may expect different arguments thus the
hints for args are blind. hints for args are blind.
@ -1417,6 +1417,9 @@ class CreateContext:
identifier (str): Creator's identifier. identifier (str): Creator's identifier.
*args (Tuple[Any]): Arguments for create method. *args (Tuple[Any]): Arguments for create method.
**kwargs (Dict[Any, Any]): Keyword argument for create method. **kwargs (Dict[Any, Any]): Keyword argument for create method.
Raises:
CreatorsCreateFailed: When creation fails.
""" """
error_message = "Failed to run Creator with identifier \"{}\". {}" error_message = "Failed to run Creator with identifier \"{}\". {}"
@ -1457,7 +1460,7 @@ class CreateContext:
]) ])
return result return result
def create_with_context( def create(
self, self,
creator_identifier, creator_identifier,
variant=None, variant=None,

View file

@ -2017,7 +2017,7 @@ class PublisherController(BasePublisherController):
success = True success = True
try: try:
self._create_context.create( self._create_context.raw_create(
creator_identifier, subset_name, instance_data, options creator_identifier, subset_name, instance_data, options
) )
except CreatorsOperationFailed as exc: except CreatorsOperationFailed as exc: