Skip to content

Commit

Permalink
Update webhooks.rst
Browse files Browse the repository at this point in the history
escape missing dependencies
  • Loading branch information
anatskiy committed Oct 12, 2016
1 parent d5dc39a commit bc51dc3
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions doc/source/admin/webhooks.rst
Expand Up @@ -91,11 +91,19 @@ helper/__init__.py
*__init__.py has* to have the **main()** function with the following (or similar) structure:

.. code-block:: python
import logging
log = logging.getLogger(__name__)
def main(trans, webhook):
error = ''
data = {}
try:
try:
from bs4 import BeautifulSoup
except ImportError as e:
log.exception(e)
return {}
# some processing...
except Exception as e:
error = str(e)
Expand Down

0 comments on commit bc51dc3

Please sign in to comment.