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

Method post

coreplugins/dronedb/api_views.py:132–153  ·  view source on GitHub ↗
(self, request)

Source from the content-addressed store, hash-verified

130
131class VerifyUrlTaskView(TaskView):
132 def post(self, request):
133
134 # Read form data
135 url = request.data.get('url', None)
136
137 if url == None:
138 return Response({'error': 'Url must be set.'}, status=status.HTTP_400_BAD_REQUEST)
139
140 _, username, password, _ = get_settings(request)
141
142 try:
143
144 result, org, ds, folder, count, size = verify_url(url, username, password).values()
145
146 if (not result):
147 return Response({'error': 'Invalid url.'}, status=status.HTTP_400_BAD_REQUEST)
148
149 return Response({'count': count, 'success': result, 'ds' : ds, 'org': org, 'folder': folder or None, 'size': size}
150 if org else {'success': False}, status=status.HTTP_200_OK)
151
152 except Exception as e:
153 return Response({'error': str(e)}, status=status.HTTP_400_BAD_REQUEST)
154
155class InfoTaskView(TaskView):
156 def get(self, request):

Callers

nothing calls this directly

Calls 3

verify_urlFunction · 0.90
get_settingsFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected