fedora-infra / fas

Fedora Account System
https://admin.fedoraproject.org/accounts
GNU General Public License v2.0
40 stars 50 forks source link

[FAS3] When searching in groups for name that doesn't exist it crashes #181

Closed skrzepto closed 7 years ago

skrzepto commented 8 years ago

Summary

When searching in groups for name that doesn't exist (eg. asdfasdfasdf) it crashes.

Steps to reproduce

  1. go to groups
  2. in search bar enter gibberish
  3. click enter

    Expected Results

Redirects us to the /groups page and notifies us that the group asdfasdfasdf does not exist.

Error Log

2016-07-19 08:45:21,993 INFO  [waitress:8221][sqlalchemy.engine.base.Engine:base][_execute_context:1100] (1, 0, u'asdfasdfasd%', u'asdfasdfasd%')
2016-07-19 08:45:21,993 INFO  [waitress:8221][sqlalchemy.engine.base.Engine:base][_rollback_impl:666] ROLLBACK
2016-07-19 08:45:21,995 ERROR [waitress:8221][pyramid_debugtoolbar:toolbar][toolbar_tween:227] Exception at http://0.0.0.0:6543/group/search/asdfasdfasd
traceback url: http://0.0.0.0:6543/_debug_toolbar/exception?token=5a1d7d28420c1909a106&tb=139974857294800
Traceback (most recent call last):
  File "/home/skrzepto/.virtualenvs/fas-python2.7/lib/python2.7/site-packages/pyramid_debugtoolbar/toolbar.py", line 209, in toolbar_tween
    response = _handler(request)
  File "/home/skrzepto/.virtualenvs/fas-python2.7/lib/python2.7/site-packages/pyramid_debugtoolbar/panels/performance.py", line 57, in resource_timer_handler
    result = handler(request)
  File "/home/skrzepto/.virtualenvs/fas-python2.7/lib/python2.7/site-packages/pyramid/tweens.py", line 62, in excview_tween
    reraise(*attrs['exc_info'])
  File "/home/skrzepto/.virtualenvs/fas-python2.7/lib/python2.7/site-packages/pyramid/tweens.py", line 22, in excview_tween
    response = handler(request)
  File "/home/skrzepto/.virtualenvs/fas-python2.7/lib/python2.7/site-packages/pyramid_tm/__init__.py", line 101, in tm_tween
    reraise(*exc_info)
  File "/home/skrzepto/.virtualenvs/fas-python2.7/lib/python2.7/site-packages/pyramid_tm/__init__.py", line 83, in tm_tween
    response = handler(request)
  File "/home/skrzepto/.virtualenvs/fas-python2.7/lib/python2.7/site-packages/pyramid/router.py", line 158, in handle_request
    view_name
  File "/home/skrzepto/.virtualenvs/fas-python2.7/lib/python2.7/site-packages/pyramid/view.py", line 547, in _call_view
    response = view_callable(context, request)
  File "/home/skrzepto/.virtualenvs/fas-python2.7/lib/python2.7/site-packages/pyramid/viewderivers.py", line 442, in rendered_view
    result = view(context, request)
  File "/home/skrzepto/.virtualenvs/fas-python2.7/lib/python2.7/site-packages/pyramid/viewderivers.py", line 123, in _class_requestonly_view
    response = getattr(inst, attr)()
  File "/home/skrzepto/Documents/repo/fas/fas/views/groups.py", line 122, in search
    _('No group found for the query: %s') % _id, 'error')
  File "/home/skrzepto/.virtualenvs/fas-python2.7/lib/python2.7/site-packages/translationstring/__init__.py", line 95, in __mod__
    'Can only interpolate translationstring '
ValueError: Can only interpolate translationstring with dictionaries.
skrzepto commented 8 years ago

user search is fine and returns a error message that user was not found

skrzepto commented 7 years ago

Works now