Bump to current manage.py, solve linting issue.

pull/1687/head
Mathijs de Bruin 2025-05-15 13:27:55 +01:00
rodzic f2909811d3
commit 8a8efe18a2
2 zmienionych plików z 18 dodań i 17 usunięć

30
manage.py 100644 → 100755
Wyświetl plik

@ -1,22 +1,22 @@
#!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "webodm.settings")
def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'webodm.settings')
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason. Ensure that the
# issue is really that Django is missing to avoid masking other
# exceptions on Python 2.
try:
import django
except ImportError:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
"available on your PYTHONPATH environment variable? Did you "
"forget to activate a virtual environment?"
)
raise
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
"available on your PYTHONPATH environment variable? Did you "
"forget to activate a virtual environment?"
) from exc
execute_from_command_line(sys.argv)
if __name__ == '__main__':
main()

Wyświetl plik

@ -48,7 +48,7 @@ def update_nodes_info():
if processing_node.hostname == check_hostname and not processing_node.is_online():
try:
socket.gethostbyname(processing_node.hostname)
except:
except: # noqa: E722
# Hostname was invalid, try renaming
processing_node.hostname = 'webodm-node-odm-1'
processing_node.update_node_info()
@ -158,7 +158,8 @@ def process_task(taskId):
logger.error(
"Uncaught error! This is potentially bad. Please report it to http://github.com/OpenDroneMap/WebODM/issues: {} {}".format(
e, traceback.format_exc()))
if settings.TESTING: raise e
if settings.TESTING:
raise e
finally:
if cancel_monitor is not None:
cancel_monitor()