[go: up one dir, main page]

Add return with finish.json

What does this MR do and why?

  • Add return statement in except so we return out of the function when we don't have proper information to continue. This was causing some server creations to silently fail.

Screenshots or screen recordings

HTTPServerRequest(protocol='https', host='x.x.x.x:8443', method='POST', uri='/api/v2/servers/', version='HTTP/1.1', remote_ip='x.x.x.x')
Traceback (most recent call last):
  File "/crafty/.venv/lib/python3.12/site-packages/tornado/web.py", line 1788, in _execute
    result = method(*self.path_args, **self.path_kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/crafty/app/classes/web/routes/api/servers/index.py", line 898, in post
    f" (ID: {new_server_id})"
             ^^^^^^^^^^^^^
UnboundLocalError: cannot access local variable 'new_server_id' where it is not associated with a value

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

  • Have you checked this doesn't interfere/conflict/duplicate someone elses work?
  • Have you fully tested your changes?
  • Have you resolved any lint issues?
  • Have you assigned a reviewer?
  • Have you applied correct labels?

Merge request reports

Loading