From 5cb59746df8acac99b7ade26c6d05a90247553f2 Mon Sep 17 00:00:00 2001 From: Isaac Bythewood Date: Thu, 4 Feb 2016 19:48:31 +0000 Subject: [PATCH] Fixes issue #37 --- pinry/core/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pinry/core/models.py b/pinry/core/models.py index 68d39cc..2c37753 100644 --- a/pinry/core/models.py +++ b/pinry/core/models.py @@ -14,7 +14,7 @@ from ..users.models import User class ImageManager(models.Manager): # FIXME: Move this into an asynchronous task def create_for_url(self, url): - file_name = url.split("/")[-1] + file_name = url.split("/")[-1].split('#')[0].split('?')[0] buf = StringIO() response = requests.get(url) buf.write(response.content)