There's a lot of duplication here.  How about something like:

```python
errors = {
    'userexists': (errors.USERNAME_TAKEN, 'username'),
    'noname': (errors.BAD_USERNAME, 'username'),
    # ... elided
}
if error in errors:
    error_slug, field_to_focus = errors[error]
    c.errors.add(error_slug)
    res._chk_error(error_slug)
    res._focus(field_to_focus)
    return
```

Also note that in line 649 the required argument to `_focus()` is missing.