Skip to content

Commit

Permalink
Fix key selection
Browse files Browse the repository at this point in the history
  • Loading branch information
cccs-sgaron committed Aug 27, 2024
1 parent 586ae77 commit 025f88e
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions assemblyline_client/v4_client/module/system.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from json import dumps

from assemblyline_client.v4_client.common.utils import api_path, get_function_kwargs
from assemblyline_client.v4_client.common.utils import api_path


class System(object):
Expand Down Expand Up @@ -81,7 +81,9 @@ def get_metadata_suggestions(self, key=None):
Optional:
key: Get only the suggestions values for the given key
"""
kw = get_function_kwargs('key')
kw = {}
if key:
kw['key'] = key
return self._connection.get(api_path('system', 'metadata_suggestions', **kw))

def set_metadata_suggestions(self, suggestions, key=None):
Expand All @@ -102,5 +104,7 @@ def set_metadata_suggestions(self, suggestions, key=None):
["a", "b", "c"] # If use with a key
"""
kw = get_function_kwargs('key')
kw = {}
if key:
kw['key'] = key
return self._connection.put(api_path('system', 'metadata_suggestions', **kw), data=dumps(suggestions))

0 comments on commit 025f88e

Please sign in to comment.