Skip to content

Commit

Permalink
chore(models-propertyclass): fix PLR0912 (#784)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nora-Olivia-Ammann committed Feb 1, 2024
1 parent 9ccd2a7 commit 51d4265
Show file tree
Hide file tree
Showing 2 changed files with 180 additions and 169 deletions.
8 changes: 4 additions & 4 deletions src/dsp_tools/commands/project/models/project.py
Expand Up @@ -360,11 +360,11 @@ def create(self) -> Project:
:return: JSON-object from DSP
"""
jsonobj = self._toJsonObj_action_create()
jsonobj = self._toJsonObj_create()
result = self._con.post(Project.ROUTE, jsonobj)
return Project.fromJsonObj(self._con, result["project"])

def _toJsonObj_action_create(self) -> dict[str, str]:
def _toJsonObj_create(self) -> dict[str, str]:
tmp = {}
if self._shortcode is None:
raise BaseError("There must be a valid project shortcode!")
Expand Down Expand Up @@ -415,11 +415,11 @@ def update(self) -> Project:
Returns: JSON object returned as response from DSP reflecting the update
"""
jsonobj = self._toJsonObj_action_update()
jsonobj = self._toJsonObj_update()
result = self._con.put(Project.IRI + quote_plus(self.iri), jsonobj)
return Project.fromJsonObj(self._con, result["project"])

def _toJsonObj_action_update(self) -> dict[str, str]:
def _toJsonObj_update(self) -> dict[str, str]:
tmp = {}
if self._shortcode is not None and "shortcode" in self._changed:
tmp["shortcode"] = self._shortcode
Expand Down

0 comments on commit 51d4265

Please sign in to comment.