fix async middleware

2 jobs for master in 27 seconds (queued for 1 second)
Status Name Job ID Coverage
  Test
failed build #123602

00:00:27

failed format #123601

00:00:14

 
Name Stage Failure
failed
build Test
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
sys:1: RuntimeWarning: coroutine 'webhook' was never awaited
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
sys:1: RuntimeWarning: coroutine 'webhook' was never awaited
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
sys:1: ResourceWarning: unclosed <ssl.SSLSocket fd=12, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('172.17.0.3', 43448), raddr=('140.82.121.6', 443)>
ResourceWarning: Enable tracemalloc to get the object allocation traceback
Cleaning up file based variables
ERROR: Job failed: exit code 1
failed
format Test
$ test -f /builds/.clang-format || ln -s /root/.clang-format /builds
$ flake8 .
/usr/local/lib/python3.6/dist-packages/flake8/plugins/manager.py:254: DeprecationWarning: SelectableGroups dict interface is deprecated. Use select.
eps = importlib_metadata.entry_points().get(self.namespace, ())
/usr/local/lib/python3.6/dist-packages/flake8/plugins/manager.py:254: DeprecationWarning: SelectableGroups dict interface is deprecated. Use select.
eps = importlib_metadata.entry_points().get(self.namespace, ())
./dashboard/middleware.py:5:1: F401 'django.http.HttpResponse' imported but unused
Cleaning up file based variables
ERROR: Job failed: exit code 1