Permalink
Browse files

fixed spreedly update handler and added a todo

  • Loading branch information...
1 parent fbdf629 commit 157e14878ef6b4a46c9a2d006324856fa4b33d2a @progrium progrium committed Jul 13, 2010
Showing with 12 additions and 10 deletions.
  1. +1 −0 TODO
  2. +11 −10 main.py
View
1 TODO
@@ -0,0 +1 @@
+- cron to get people to make hd account, every 2 weeks
View
21 main.py
@@ -211,16 +211,17 @@ def post(self, ids=None):
for id in subscriber_ids:
subscriber = s.subscriber_details(sub_id=int(id))
member = Membership.get_by_id(int(subscriber['customer-id']))
- if member.status == 'paypal':
- mail.send_mail(sender=EMAIL_FROM,
- to="PayPal <paypal@hackerdojo.com>",
- subject="Please cancel PayPal subscription for %s" % member.full_name(),
- body=member.email)
- member.status = 'active' if subscriber['active'] == 'true' else 'suspended'
- member.spreedly_token = subscriber['token']
- member.plan = subscriber['feature-level'] or member.plan
- member.email = subscriber['email']
- member.put()
+ if member:
+ if member.status == 'paypal':
+ mail.send_mail(sender=EMAIL_FROM,
+ to="PayPal <paypal@hackerdojo.com>",
+ subject="Please cancel PayPal subscription for %s" % member.full_name(),
+ body=member.email)
+ member.status = 'active' if subscriber['active'] == 'true' else 'suspended'
+ member.spreedly_token = subscriber['token']
+ member.plan = subscriber['feature-level'] or member.plan
+ member.email = subscriber['email']
+ member.put()
self.response.out.write("ok")
class LinkedHandler(webapp.RequestHandler):

0 comments on commit 157e148

Please sign in to comment.