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

[images] Fix create_default_topology condition check #421 #422

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion images/openwisp_dashboard/load_init_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,6 @@ def create_default_topology(vpn):
create_default_credentials()
create_ssh_key_template()

if os.environ.get('USE_OPENWISP_TOPOLOGY', False):
if os.environ.get('USE_OPENWISP_TOPOLOGY', False) == "True":
Copy link
Member

Choose a reason for hiding this comment

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

Can we use env_bool here instead? So, it will be consistent with the rest of the code.

Suggested change
if os.environ.get('USE_OPENWISP_TOPOLOGY', False) == "True":
if env_bool(os.environ.get('USE_OPENWISP_TOPOLOGY')):

Here's an example:

if env_bool(os.environ.get('USE_OPENWISP_TOPOLOGY')):
from openwisp_network_topology.routing import ( # noqa: E402
websocket_urlpatterns as network_topology_routes,
)

Topology = load_model('topology', 'Topology')
create_default_topology(default_vpn)