Skip to content

Commit

Permalink
Fixing about 4 bugs that have to do with logging, activating broken p…
Browse files Browse the repository at this point in the history
…remiums, and importing from google reader when the user already has feeds and they aren't being cleared out (broken since friday july 20th, a week ago). Thanks to Luke Dieker for the find.
  • Loading branch information
samuelclay committed Jul 27, 2012
1 parent 22582e1 commit 2657d71
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
2 changes: 2 additions & 0 deletions apps/feed_import/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,8 @@ def process_feeds(self, feeds_xml):

folders = self.rearrange_folders(folders)
logging.user(self.user, "~BB~FW~SBGoogle Reader import: ~BT~FW%s" % (self.subscription_folders))

self.clear_folders()
UserSubscriptionFolders.objects.get_or_create(user=self.user, defaults=dict(
folders=json.encode(self.subscription_folders)))

Expand Down
8 changes: 6 additions & 2 deletions apps/profile/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,12 @@ def paypal_signup(sender, **kwargs):
subscription_signup.connect(paypal_signup)

def stripe_signup(sender, full_json, **kwargs):
profile = Profile.objects.get(stripe_id=full_json['data']['object']['customer'])
profile.activate_premium()
stripe_id = full_json['data']['object']['customer']
try:
profile = Profile.objects.get(stripe_id=stripe_id)
profile.activate_premium()
except Profile.DoesNotExist:
return {"code": -1, "message": "User doesn't exist."}
zebra_webhook_customer_subscription_created.connect(stripe_signup)

def change_password(user, old_password, new_password):
Expand Down
2 changes: 1 addition & 1 deletion utils/mongo_raw_log_middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def process_view(self, request, callback, callback_args, callback_kwargs):
return None

def process_response(self, request, response):
if settings.DEBUG:
if settings.DEBUG and hasattr(self, 'orig_send_message') and hasattr(self, 'orig_send_message_with_response'):
# remove instrumentation from pymongo
Connection._send_message = \
self.orig_send_message
Expand Down
2 changes: 1 addition & 1 deletion utils/redis_raw_log_middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def process_view(self, request, callback, callback_args, callback_kwargs):
return None

def process_response(self, request, response):
if settings.DEBUG:
if settings.DEBUG and hasattr(self, 'orig_pack_command'):
# remove instrumentation from redis
Connection.pack_command = \
self.orig_pack_command
Expand Down

0 comments on commit 2657d71

Please sign in to comment.