Skip to content

Conversation

@josenavas
Copy link
Contributor

No description provided.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.03%) to 82.838% when pulling 6b5a69a on josenavas:fix-user-verify into 5345a85 on biocore:master.

WHERE email = 'new@test.bar' AND dflt = true"""
self.assertEqual(self.conn_handler.execute_fetchone(sql)[0], 2)

# Make sure new system messages are linked to user
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be put in test_create to make sure this test is still done.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree and more importantly we need to make sure the pathological case doesn't happens. I have created: #1731

@squirrelo
Copy link
Contributor

General question: Why move this one piece from verify to create? It was originally in verify because a user can't log in until they are verified, so we saved extra message rows for users that sat unverified. Also, any messages that expire before a user verifies shouldn't matter since they expired before the user can log in and see them.

@antgonza
Copy link
Member

@squirrelo the original code has a pathological case: if a user registers, then messages get added, and the user tries to verify their email, the system will fail cause the messages have already been added:

ValueError: Error running SQL query:
Query: INSERT INTO qiita.message_user (email, message_id)
                             SELECT %s, message_id FROM qiita.message
                             WHERE expiration > %s
Arguments: ['my_email@email.com', datetime.datetime(2016, 3, 31, 4, 49, 43, 242531)]
Error: duplicate key value violates unique constraint "idx_message_user"
DETAIL:  Key (email, message_id)=(my_email@email.com, 16) already exists.

@antgonza
Copy link
Member

Closing in favor of: #1731

@antgonza antgonza closed this Mar 31, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants