Skip to content

Commit

Permalink
Updated Check URL
Browse files Browse the repository at this point in the history
  • Loading branch information
dyohan9 committed Oct 8, 2019
1 parent 4409b7b commit fa7c8b4
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions bothub/api/v2/nlp/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -425,13 +425,12 @@ def retrieve(self, request, *args, **kwargs):

try:
validator(str(update.bot_data))
try:
download = requests.get(update.bot_data)
bot_data = base64.b64encode(download.content)
except Exception:
bot_data = b""
download = requests.get(update.bot_data)
bot_data = base64.b64encode(download.content)
except ValidationError:
bot_data = update.bot_data
except Exception:
bot_data = b""

return Response(
{
Expand Down

0 comments on commit fa7c8b4

Please sign in to comment.