From 8b5b9c9f816e82100dd7a1cc81ece8529979b720 Mon Sep 17 00:00:00 2001 From: "claytonc.sousa@gmail.com" Date: Sat, 9 Sep 2017 16:28:18 -0300 Subject: [PATCH] #128 - fixed test --- sc/social/like/utils.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sc/social/like/utils.py b/sc/social/like/utils.py index e7e83ad0..b121a0d2 100644 --- a/sc/social/like/utils.py +++ b/sc/social/like/utils.py @@ -149,7 +149,11 @@ def validate_image_social(value): logger.info(msg.format(type)) return msg.format(type) - if value.data.size > 5242880: + try: + size = value.size + except AttributeError: + size = value.data.size + if size > 5242880: msg = u'Image size should be less than 5MB.' logger.info(msg) return msg