def accept_application(self, *args): if not args: return "specify sponsor name (case sensitive)" from model.employer import Sponsor_Application this_sponsor = Sponsor_Application.gql("WHERE name = :1", args[0]).get() from employer.methods import DataMethods dm = DataMethods() if this_sponsor is None: return "application not found" new_account = dm.create_business_account(this_sponsor.name, this_sponsor.email, proficiencies=False, batch=False) from accounts.mail import mail_sponsor_intro if len(new_account) > 1: mail_sponsor_intro(new_account[1]) else: return "not mailing intro - it appears that this application has already been accepted" return "OK"
def sponsor_apply(self): from model.employer import Sponsor_Application sponsor_app = Sponsor_Application(name = self.request.get('name'), email = self.request.get('email') ) sponsor_app.put() return "OK"