Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dinger1986 mesh name to initial #1807

Closed
wants to merge 5 commits into from
Closed

Dinger1986 mesh name to initial #1807

wants to merge 5 commits into from

Conversation

dinger1986
Copy link
Collaborator

No description provided.

@dinger1986 dinger1986 marked this pull request as draft March 19, 2024 23:21
@@ -93,6 +93,10 @@ def post(self, request):
core = get_core_settings()
core.default_time_zone = request.data["timezone"]
core.save(update_fields=["default_time_zone"])
# add in mesh company name
if "mesh_company_name" in request.data:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. no need to create a separate if block because we already have one to check if this is being called from initialsetup
  2. request.data["mesh_company_name"] wont' work because on the frontend you are setting the variable to companyname not mesh_company_name
  3. update_fields_list variable doesn't exist anywhere so you're trying to append to a non existing variable
  4. no call to save in your new if block so even if it was right, would not actually get saved to db

here is how we can make it work using the existing if block:

if "initialsetup" in request.data.keys():
    core = get_core_settings()
    core.default_time_zone = request.data["timezone"]
    core.mesh_company_name = request.data["companyname"]
    core.save(update_fields=["default_time_zone", "mesh_company_name"])

@dinger1986 dinger1986 closed this Mar 20, 2024
@dinger1986 dinger1986 deleted the dinger1986-mesh-name-to-initial branch March 20, 2024 08:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants