From d67a368fc07b4f3a6220de136015df777a1bcce3 Mon Sep 17 00:00:00 2001 From: Anoopsmohan Date: Thu, 7 Mar 2013 02:15:00 +0530 Subject: [PATCH] condition changes to is_uploaded --- user_info/views.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/user_info/views.py b/user_info/views.py index 9521d98..ebde23a 100644 --- a/user_info/views.py +++ b/user_info/views.py @@ -20,7 +20,7 @@ def get_info(limit): while(1): try: base_id += 1 - info = requests.get('http://vimeo.com/api/v2/%s/info.json' % str(base_id)).json() + info = requests.get('http://vimeo.com/api/v2/%s/info.json' % str(base_id)).json if UserDetails.objects.filter(profile_url=info['profile_url']).exists(): continue user_info = UserDetails() @@ -28,7 +28,7 @@ def get_info(limit): user_info.profile_url = info['profile_url'] user_info.paying = int(info['is_plus']) user_info.staff_pick = False - videos = requests.get('http://vimeo.com/api/v2/%s/videos.json' % str(base_id)).json() + videos = requests.get('http://vimeo.com/api/v2/%s/videos.json' % str(base_id)).json for video in videos: response = requests.get(video['url']) staff_pick = re.search('"name":"staffpicks"', response.content) @@ -36,7 +36,7 @@ def get_info(limit): user_info.staff_pick = True user_info.staff_pick_url = video['url'] break - if int(info['total_videos_uploaded']) >= 0: + if int(info['total_videos_uploaded']) > 0: user_info.video_uploaded = 1 else: user_info.video_uploaded = 0