Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validate username format before attempting to flush it to the db #2489

Closed
dstufft opened this issue Oct 10, 2017 · 0 comments
Closed

Validate username format before attempting to flush it to the db #2489

dstufft opened this issue Oct 10, 2017 · 0 comments
Labels

Comments

@dstufft
Copy link
Member

dstufft commented Oct 10, 2017

Validate a valid username prior to trying to save it to the database, using the same logic as is already in the database.


https://sentry.io/python-software-foundation/warehouse-production/issues/258353802/

IntegrityError: new row for relation "accounts_user" violates check constraint "accounts_user_valid_username"

  File "sqlalchemy/engine/base.py", line 1182, in _execute_context
    context)
  File "sqlalchemy/engine/default.py", line 470, in do_execute
    cursor.execute(statement, parameters)

IntegrityError: (psycopg2.IntegrityError) new row for relation "accounts_user" violates check constraint "accounts_user_valid_username"
(30 additional frame(s) were not displayed)
...
  File "warehouse/raven.py", line 41, in raven_tween
    return handler(request)
  File "warehouse/cache/http.py", line 69, in conditional_http_tween
    response = handler(request)
  File "warehouse/cache/http.py", line 33, in wrapped
    return view(context, request)
  File "warehouse/accounts/views.py", line 226, in register
    form.email.data
  File "warehouse/accounts/services.py", line 152, in create_user
    self.db.flush()

IntegrityError: (psycopg2.IntegrityError) new row for relation "accounts_user" violates check constraint "accounts_user_valid_username"
DETAIL:  Failing row contains 
yeraydiazdiaz pushed a commit to yeraydiazdiaz/warehouse that referenced this issue Oct 21, 2017
yeraydiazdiaz pushed a commit to yeraydiazdiaz/warehouse that referenced this issue Oct 21, 2017
yeraydiazdiaz pushed a commit to yeraydiazdiaz/warehouse that referenced this issue Oct 21, 2017
@alex alex closed this as completed in 34a64d6 Oct 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant