Example #1
0
    def get(self):
        user = users.get_current_user()
        if not user:
            self.redirect(users.create_login_url(self.request.uri))
            return

        member = Membership.get_by_email(user.email())
        if not member:
            # User is not (yet) a member.
            self.redirect("/")
            return
        else:
            # Open billing information.
            url = member.spreedly_url()
            plan = Plan.get_by_name(member.plan)
            if plan.legacy:
                # Show the legacy plan warning.
                current = plan.get_legacy_pair()
                self.response.out.write(
                    self.render("templates/billing_popup.html",
                                url=url,
                                legacy=plan,
                                current=current))
                return
            else:
                self.redirect(url)
                return
Example #2
0
  def get(self):
    user = users.get_current_user()
    if not user:
      self.redirect(users.create_login_url(self.request.uri))
      return

    member = Membership.get_by_email(user.email())
    if not member:
      # User is not (yet) a member.
      self.redirect("/")
      return
    else:
      # Open billing information.
      url = member.spreedly_url()
      plan = Plan.get_by_name(member.plan)
      if plan.legacy:
        # Show the legacy plan warning.
        current = plan.get_legacy_pair()
        self.response.out.write(self.render(
            "templates/billing_popup.html",
            url=url, legacy=plan, current=current))
        return
      else:
        self.redirect(url)
        return
Example #3
0
 def get(self):
   user = users.get_current_user()
   member = Membership.get_by_email(user.email())
   if not member:
     # User is not (yet) a member.
     self.redirect("/")
   else:
     # Open billing information.
     url = member.spreedly_url()
     plan = Plan.get_by_name(member.plan)
     if plan.legacy:
       self.response.out.write(self.render(
           "templates/billing_popup.html", url=url))
     else:
       self.redirect(url)
Example #4
0
    def test_aliases(self):
        self.plan1.aliases = ["alias"]

        plan1 = Plan.get_by_name("alias")
        self.assertEqual(self.plan1, plan1)
Example #5
0
  def test_aliases(self):
    self.plan1.aliases = ["alias"]

    plan1 = Plan.get_by_name("alias")
    self.assertEqual(self.plan1, plan1)