Skip to content

Commit

Permalink
[Fixes #20] add user create function
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcel Wallschlaeger committed May 6, 2024
1 parent e8b3b75 commit e0ca65b
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions geonoderest/geonodeobject.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ def cmd_patch(
ValueError: catches json.decoder.JSONDecodeError and raises ValueError as decoding is not working
"""

json_content = None
if json_path:
with open(json_path, "r") as file:
try:
Expand All @@ -80,14 +79,13 @@ def cmd_patch(
if json_content is not None and "attribute_set" in json_content:
json_content.pop("attribute_set", None)

if fields:
elif fields:
try:
f_dict = json.loads(fields)
json_content = {**json_content, **f_dict}
json_content = json.loads(fields)
except json.decoder.JSONDecodeError as E:
json_decode_error_handler(fields, E)

if json_content is None:
else:
raise ValueError(
"At least one of 'fields' or 'json_path' must be provided."
)
Expand Down

0 comments on commit e0ca65b

Please sign in to comment.