- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
您好,我在运行 MRI 2.2.3 的 Rails 4.2.4 应用程序中使用 Devise 3.5.3,配置如下:
app/models/user.rb:
devise :confirmable, :database_authenticatable, :registerable, :recoverable, :rememberable, :trackable, :validatable
Started POST "/users" for ::1 at 2016-01-19 08:42:12 -0800
Processing by RegistrationsController#create as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"VINuBSmtWh2j7oVY0JgGqHB/d7Ue6YZOdnEfGjGlwU7sY0GD0dvmQ0hSBxzGGQlM4i+h5sByMVanRWo2y0mqqA==", "user"=>{"email"=>"admin@test.com"}, "commit"=>"Join"}
(0.1ms) BEGIN
(0.6ms) SELECT "users"."pid" FROM "users"
User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."confirmation_token" = $1 ORDER BY "users"."id" ASC LIMIT 1 [["confirmation_token", "f8da655cda392edf619184fac68b3d03728c3a34abfc99e3026d1727a8d2964e"]]
SQL (0.4ms) INSERT INTO "users" ("email", "pid", "created_at", "updated_at", "confirmation_token", "confirmation_sent_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["email", "admin@test.com"], ["pid", "isgt"], ["created_at", "2016-01-19 16:42:12.148537"], ["updated_at", "2016-01-19 16:42:12.148537"], ["confirmation_token", "tsK97z8Ae2jNzKxUCPyj"], ["confirmation_sent_at", "2016-01-19 16:42:12.379778"]]
Rendered devise/mailer/confirmation_instructions.html.slim (3.8ms)
Devise::Mailer#confirmation_instructions: processed outbound mail in 222.8ms
Sent mail to admin@test.com (368.0ms)
Date: Tue, 19 Jan 2016 08:42:12 -0800
From: team@example.com
Reply-To: team@example.com
To: admin@test.com
Message-ID: <569e6764987cf_170e83ff5065e9ae4779a7@flat-top.local.mail>
Subject: Confirmation instructions
Mime-Version: 1.0
Content-Type: text/html;
charset=UTF-8
Content-Transfer-Encoding: 7bit
<p>
Welcome admin@test.com!
</p>
<p>
You can confirm your account email through the link below:
</p>
<p>
<a href="http://localhost:3000/users/confirmation?confirmation_token=tsK97z8Ae2jNzKxUCPyj">Confirm my account</a>
</p>
User Exists (0.5ms) SELECT 1 AS one FROM "users" WHERE (LOWER("users"."email") = LOWER('admin@test.com') AND "users"."id" != 80) LIMIT 1
(0.3ms) ROLLBACK
(0.1ms) BEGIN
SQL (8.9ms) INSERT INTO "users" ("last_sign_in_at", "current_sign_in_at", "last_sign_in_ip", "current_sign_in_ip", "sign_in_count") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["last_sign_in_at", "2016-01-19 16:42:13.006971"], ["current_sign_in_at", "2016-01-19 16:42:13.006971"], ["last_sign_in_ip", "::1/128"], ["current_sign_in_ip", "::1/128"], ["sign_in_count", 1]]
PG::NotNullViolation: ERROR: null value in column "pid" violates not-null constraint
DETAIL: Failing row contains (81, null, null, null, null, user, , , null, null, null, 1, 2016-01-19 16:42:13.006971, 2016-01-19 16:42:13.006971, ::1, ::1, null, null, null, null, null, null, null, null, null, null, null, null).
: INSERT INTO "users" ("last_sign_in_at", "current_sign_in_at", "last_sign_in_ip", "current_sign_in_ip", "sign_in_count") VALUES ($1, $2, $3, $4, $5) RETURNING "id"
(0.1ms) ROLLBACK
Completed 500 Internal Server Error in 876ms (ActiveRecord: 11.7ms)
PG::NotNullViolation - ERROR: null value in column "pid" violates not-null constraint
DETAIL: Failing row contains (81, null, null, null, null, user, , , null, null, null, 1, 2016-01-19 16:42:13.006971, 2016-01-19 16:42:13.006971, ::1, ::1, null, null, null, null, null, null, null, null, null, null, null, null).
最佳答案
我发现有一个验证错误导致第一个 INSERT 无声地失败 所以当 :trackable
出现时,记录不在那里更新。如果我注意到没有返回任何 COMMIT 消息,我就会早点发现它。
为了帮助其他人,这里是解决验证错误后的日志条目:
Started POST "/users" for ::1 at 2016-01-19 12:17:54 -0800
ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
Processing by RegistrationsController#create as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"s7xFg67CJ85OCnkZKROPkzNRBCWw3hhJQiUW0FeHLdjSBzPP8jMvIgaCVxJFPbA59UnBOZisA8h7lntvaqtJ4w==", "user"=>{"email"=>"admin@test.com"}, "commit"=>"Join"}
(0.2ms) BEGIN
(0.6ms) SELECT "users"."pid" FROM "users"
User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."confirmation_token" = $1 ORDER BY "users"."id" ASC LIMIT 1 [["confirmation_token", "ebb817b51ee9a457f75fe58d1fd29f19fb0c64cbd65122cdbe1935e8c56e48ab"]]
SQL (0.4ms) INSERT INTO "users" ("email", "pid", "created_at", "updated_at", "confirmation_token", "confirmation_sent_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["email", "admin@test.com"], ["pid", "93412"], ["created_at", "2016-01-19 20:17:54.650641"], ["updated_at", "2016-01-19 20:17:54.650641"], ["confirmation_token", "vEPtNFijrDhw5TjFh1Qy"], ["confirmation_sent_at", "2016-01-19 20:17:54.861593"]]
Rendered devise/mailer/confirmation_instructions.html.slim (14.5ms)
Devise::Mailer#confirmation_instructions: processed outbound mail in 301.6ms
Sent mail to admin@test.com (334.7ms)
Date: Tue, 19 Jan 2016 12:17:55 -0800
From: team@example.com
Reply-To: team@example.com
To: admin@test.com
Message-ID: <569e99f32d4b0_dcb3ff7a2548e707039@flat-top.local.mail>
Subject: Confirmation instructions
Mime-Version: 1.0
Content-Type: text/html;
charset=UTF-8
Content-Transfer-Encoding: 7bit
<p>
Welcome admin@test.com!
</p>
<p>
You can confirm your account email through the link below:
</p>
<p>
<a href="http://localhost:3000/users/confirmation?confirmation_token=vEPtNFijrDhw5TjFh1Qy">Confirm my account</a>
</p>
User Exists (0.5ms) SELECT 1 AS one FROM "users" WHERE (LOWER("users"."email") = LOWER('admin@test.com') AND "users"."id" != 10) LIMIT 1
(6.4ms) COMMIT
(0.1ms) BEGIN
SQL (0.3ms) UPDATE "users" SET "last_sign_in_at" = $1, "current_sign_in_at" = $2, "last_sign_in_ip" = $3, "current_sign_in_ip" = $4, "sign_in_count" = $5, "updated_at" = $6 WHERE "users"."id" = $7 [["last_sign_in_at", "2016-01-19 20:17:55.540280"], ["current_sign_in_at", "2016-01-19 20:17:55.540280"], ["last_sign_in_ip", "::1/128"], ["current_sign_in_ip", "::1/128"], ["sign_in_count", 1], ["updated_at", "2016-01-19 20:17:55.541519"], ["id", 10]]
(6.0ms) COMMIT
关于postgresql - 为什么设计注册#create,:trackable doing an INSERT instead of UPDATE?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34885581/
我有一个问题,想知道如何在已经使用常规登录/注册系统的网站上集成第 3 方登录(也进行静默注册)。 基本上当前登录还是比较规律的: 当用户进入网站 session 时类(class)决定他是否需要重新
我在学习 Hyperledger Fabric 并运行示例代码。 我仍在尝试正确了解事情的运作方式,尤其是在使用证书和加密 Material 的用户/管理员注册和注册中。 我想知道以下如何工作。 1)
我正在尝试使用从我的 Android 设备的 PassWallet 应用程序中保存的票证中获取的 token 向我的设备发送消息。 设备发送使用苹果钱包规范更新通行证所需的所有信息。但是,我正在使用
使用 Passport 本地示例,我可以登录工作。没有关于如何注册用户的文档。 我想为用户提供一个“电子邮件”和“密码”字段,他们可以使用它们来注册该网站。我怎样才能做到这一点?有什么原因没有记录下来
在之前的一些 WSO2IS 版本中,有一个默认的 self 注册功能。但是,我在 5.0 版本中找不到它。 阅读 WSO2IS 5.0 文档,我发现有 2 个用于此功能的 API: getUserId
我已将 Airship SDK 集成到 Android 应用程序中。在应用程序启动和飞艇起飞后,我在日志中得到以下调试信息: 07-27 12:46:31.916 XXX - UALib( 1545)
Delphi 中设计时包的可怕错误之一是以下错误,这意味着注册安装新组件到您的 Palette 上的包: Component TSomething can't be registered by pac
我发现的大部分内容都使用 php 或类似的东西。 我有一个 Angular 前端和 Node/express 服务器代码。还没有后端。我不确定如何继续用户注册。 最佳答案 在没有后端的情况下进行注册等
我正在使用 Drupal 6 开发一个网站。我正在使用我自己的主题,并且一切正常。现在我需要使用我的自定义主题在我的网站上创建一个自定义登录/注册表单。我尝试了很多方法,但一切都重定向到我的管理主题,
我在运行此代码时收到 Sip 异常。这是因为 manager.register(me,20,listener)。 下面是我的代码,所以请帮我更正这段代码。我正在使用 SipDemo 代码注册我的帐户。
在过去的几天里,我一直在尝试为基于 VUE 的 excel 制作任务 Pane 插件。 我已按照 link 的指南进行操作我试图为 onSelectionChange 注册一个事件处理程序。它已经有些
我需要在使用 django-registration 应用程序的登录表单中实现一个“记住我”按钮。任何ane可以帮助我向我展示这样做的方法吗? 谢谢 最佳答案 一种方法是更改 session 到期
我发现,如果您使用 Django 1.5 版本,则 django 注册模块会中断,因为在最新的 django 开发版本中,simple.py 类已被删除。 最佳答案 此问题现已修复: hg clone
我正在尝试将 facebook connect 实现到我的网站,但有几个问题。 1:是否可以使用用户当前的 Facebook 电子邮件/密码在我的网站上注册用户。 假设用户点击链接通过 faceboo
我使用 Facebook 注册来允许人们在我的网站上注册。有没有可能,在注册后,他在我的网站注册的成员(member)墙上会张贴? 最佳答案 这可能不是您正在寻找的答案,但我强烈建议您不要这样做。用户
I would like to use a slash (/) for a search during a vimscript, but I don't want to overwrite the "
我正在使用 jqgrid 并且有显示日期的列,但是来自服务器的日期以 json 格式出现,如下所示, "CommentedDate": "\/Date(1304324941000+0530)\/" 如
我希望用户可以直接登录主页,而不是在“../account/login/”页面上登录。我应该做什么才能使它成为可能?如何将主页上的输入字段与 allauth 连接?我不知道这样是否太复杂而无法以这种方
This question already has answers here: Understanding NSString comparison (7个答案) 5年前关闭。 我正在尝试制作注册表。有
我正在使用 Django 注册。它提供了处理 registration_form.html 的 View ,该 html 当前包含用户名、密码 1、密码 2 和电子邮件作为我的应用程序中的用户可输入字
我是一名优秀的程序员,十分优秀!