Skip to content

Commit 4cbbace

Browse files
committed
fix linting
1 parent 9318d25 commit 4cbbace

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

tom_dataservices/dataservices.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
from django.apps import apps
77
from django.utils.module_loading import import_string
88

9+
from tom_targets.models import TargetName
10+
911
logger = logging.getLogger(__name__)
1012

1113

@@ -315,12 +317,15 @@ def create_target_extras_from_query(self, query_results, **kwargs):
315317
"""
316318
return {}
317319

318-
def create_aliases_from_query(self, alias_results:List, **kwargs)->List:
320+
def create_aliases_from_query(self, alias_results: List, **kwargs) -> List:
319321
"""Create a new target from the query results
320322
This method should be over ridden with a method that creates a list of TargetName objects:
321323
`TargetName(name=alias)` that will be saved as part of the `Target.save(extras=extras, names=aliases)` call.
322324
:param query_result: list of dictionaries describing target details based on query result
323325
:returns: list of TargetName objects to be added to a new Target
324326
:rtype: `list`
325327
"""
326-
return []
328+
aliases = []
329+
for alias in alias_results:
330+
aliases.append(TargetName(name=alias))
331+
return aliases

0 commit comments

Comments
 (0)