MCPcopy Index your code
hub / github.com/WebODM/WebODM / index

Method index

coreplugins/tasknotification/plugin.py:92–110  ·  view source on GitHub ↗
(request)

Source from the content-addressed store, hash-verified

90
91 @login_required
92 def index(request):
93 if request.method == "POST":
94
95 form = ConfigurationForm(request.POST)
96 test_configuration = request.POST.get("test_configuration")
97 if form.is_valid() and test_configuration:
98 form.test_settings(request)
99 elif form.is_valid() and not test_configuration:
100 form.save_settings()
101 messages.success(request, "Notification settings applied successfully!")
102 else:
103 config_data = config.load()
104
105 # notification_app_name initial value should be whatever is defined in the settings
106 settings = Setting.objects.first()
107 config_data['notification_app_name'] = config_data['notification_app_name'] or settings.app_name
108 form = ConfigurationForm(initial=config_data)
109
110 return render(request, self.template_path('index.html'), {'form' : form, 'title' : 'Task Notification'})
111
112 return [
113 MountPoint('$', index),

Callers

nothing calls this directly

Calls 6

test_settingsMethod · 0.95
save_settingsMethod · 0.95
firstMethod · 0.80
template_pathMethod · 0.80
ConfigurationFormClass · 0.70
getMethod · 0.45

Tested by

no test coverage detected