Skip to content

Commit

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

try:
validator(str(update.bot_data))
url_valid = True
except ValidationError:
url_valid = False

if url_valid:
try:
download = requests.get(update.bot_data)
bot_data = base64.b64encode(download.content)
except Exception:
bot_data = b""
else:
except ValidationError:
bot_data = update.bot_data

return Response(
{
"update_id": update.id,
Expand Down

0 comments on commit 4409b7b

Please sign in to comment.