updated company button

This commit is contained in:
seangreaves
2024-10-24 10:11:53 +01:00
parent 238a5bd860
commit bcc153e3dd

View File

@@ -151,25 +151,25 @@
"navigation_button = widgets.Button(description='Update', disabled=True)\n",
"navigation_button.on_click(lambda bt: config_network()) \n",
"\n",
"def init_network():\n",
" init_button.disabled=True\n",
" response = sugartrail.api.get_company(str(company_text.value))\n",
" company_text.disabled=True\n",
"def init_network(bt):\n",
" init_button.disabled = True\n",
" company_id = company_text.value # Capture the latest value of company_text\n",
" response = sugartrail.api.get_company(str(company_id))\n",
" company_text.disabled = True\n",
" if response:\n",
" network.company_id = str(company_text.value)\n",
" network.company_id = company_id\n",
" init_status.value = u'\\u2705: Initialisation successful for ' + str(response['company_name']) \n",
" init_button.button_style='success'\n",
" init_button.button_style = 'success'\n",
" navigation_button.disabled = False\n",
" depth_selector.disabled = False\n",
" generate_network_button.disabled = False\n",
" logger.debug(f\"Company number entered: {str(company_text.value)}\")\n",
" \n",
" logger.debug(f\"Company number entered: {company_id}\") # Log the captured value\n",
" else:\n",
" init_button.disabled=False\n",
" company_text.disabled=False\n",
" init_status.value = u'\\u274c: Initialisation Failed. No records for company: ' + str(company_text.value)\n",
" init_button.disabled = False\n",
" company_text.disabled = False\n",
" init_status.value = u'\\u274c: Initialisation Failed. No records for company: ' + company_id\n",
"\n",
"display(company_text, init_button, init_status)"
"display(company_text, init_button, init_status)\n"
]
},
{