0

リンク(下記)が受信者の電子メールアドレスに送信される電子メール確認を設定しようとしています。リンクをクリックして、「post_id」を取得し、パラメータ「i」に関連付けられたユーザー レコードのキーと比較するプロセスに移動します。

それらが等しい場合、接続 URL は有効です。私はただテストを機能させることができません。

リンク = http://letshudder.appspot.com/email/confirmation/5662278724616192?i=MichaelClay

コード

    def get(self, post_id):
        logging.debug("In email confirmation for userid %s" % post_id)

        linkid = self.request.GET.get("i")
        uid = User.by_id_name(linkid)
        logging.debug("The uid of the inviter is %s" % uid)
        logging.debug("with a length of %s" % len(str(uid)))
        logging.debug("This should match the id value from the link: %s" % post_id)
        logging.debug("with a length of %s" % len(str(post_id)))

        if uid >= post_id:
            logging.debug("UID wins")

        if post_id >= uid:
            logging.debug("post_id wins")

        if uid != post_id:
            logging.debug("UID and LINKID did not match")
            self.redirect('/invalid_url')
            return

. . .

デバッグ出力:

D 2013-08-29 19:18:28.871 In email confirmation for userid 5662278724616192

I 2013-08-29 19:18:28.887 the userid is: MichaelClay

D 2013-08-29 19:18:28.887 The uid of the inviter is 5662278724616192

D 2013-08-29 19:18:28.887 with a length of 16

D 2013-08-29 19:18:28.887 This should match the id value from the link: 5662278724616192

D 2013-08-29 19:18:28.887 with a length of 16

D 2013-08-29 19:18:28.887 post_id wins

Google Apps Engine で Python 2.7 を実行しています。何か案は?

4

1 に答える 1