Skip to content

Commit

Permalink
Refactor variable names in user_service_status function and ProxmoxCl…
Browse files Browse the repository at this point in the history
…ient
  • Loading branch information
dkmstr committed Oct 3, 2024
1 parent 1a7a486 commit fa24a5e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions server/src/uds/REST/methods/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def process(self, ticket: str, scrambler: str) -> dict[str, typing.Any]:
'Res: %s',
info
)
password = CryptoManager().symmetric_decrypt(data['password'], scrambler)
password = CryptoManager.manager().symmetric_decrypt(data['password'], scrambler)

# userService.setConnectionSource(srcIp, hostname) # Store where we are accessing from so we can notify Service
if not info.ip:
Expand Down Expand Up @@ -193,10 +193,10 @@ def get(self) -> dict[str, typing.Any]:
"""
logger.debug('Client args for GET: %s', self._args)

def error() -> None:
def _error() -> None:
raise exceptions.rest.RequestError('Invalid request')

def noargs() -> dict[str, typing.Any]:
def _noargs() -> dict[str, typing.Any]:
return Client.result(
{
'availableVersion': CLIENT_VERSION, # Compat with old clients, TB removed soon...
Expand All @@ -210,8 +210,8 @@ def noargs() -> dict[str, typing.Any]:

return match(
self._args,
error, # In case of error, raises RequestError
((), noargs), # No args, return version
_error, # In case of error, raises RequestError
((), _noargs), # No args, return version
(('test',), self.test), # Test request, returns "Correct"
(
(
Expand Down
2 changes: 1 addition & 1 deletion server/src/uds/core/util/properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def __setitem__(self, key: str, value: typing.Any) -> None:
try:
p = self._filter().get(key=key)
p.value = value
p.save()
p.save(update_fields=['value'])
except Properties.DoesNotExist:
Properties.objects.create(owner_id=self.owner_id, owner_type=self.owner_type, key=key, value=value)

Expand Down

0 comments on commit fa24a5e

Please sign in to comment.