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

need to fix CommonDisambiguationError #377

Closed
redilonka opened this issue Mar 16, 2017 · 1 comment
Closed

need to fix CommonDisambiguationError #377

redilonka opened this issue Mar 16, 2017 · 1 comment
Assignees
Labels

Comments

@redilonka
Copy link
Collaborator

redilonka commented Mar 16, 2017

str: (ct/teach/courses/4/units/16/concepts/231/errors/)

  1. open courses
  2. open units
  3. open concepts
  4. open errors
  5. search=tr
  6. Link to this Concept

AR: Exception: There are more than one articles for that query
ER: Link to this Concept

Traceback:
File "/home/wwwapps/_ve_socraticqs2/local/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
  132.                     response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/home/wwwapps/_ve_socraticqs2/local/lib/python2.7/site-packages/django/contrib/auth/decorators.py" in _wrapped_view
  22.                 return view_func(request, *args, **kwargs)
File "/home/wwwapps/socraticqs2/mysite/ct/views.py" in concept_errors
  732.                   unit=unit, showConceptAction=True, isError=True)
File "/home/wwwapps/socraticqs2/mysite/ct/views.py" in _concepts
  539.                                         request.user)
File "/home/wwwapps/socraticqs2/mysite/ct/models.py" in get_from_sourceDB
  27.         lesson = Lesson.get_from_sourceDB(sourceID, user, sourceDB)
File "/home/wwwapps/socraticqs2/mysite/ct/models.py" in get_from_sourceDB
  262.         data = dataClass(sourceID)
File "/home/wwwapps/socraticqs2/mysite/ct/sourcedb_plugin/wikipedia_plugin.py" in __init__
  17.             raise CommonDisambiguationError(getattr(e, 'options'))

Exception Type: CommonDisambiguationError at /ct/teach/courses/4/units/16/concepts/231/errors/
Exception Value: There are more than one articles for that query
@alexbojko
Copy link
Collaborator

In file ct/views.py:553

elif 'search' in request.GET:
        searchForm = ConceptSearchForm(request.GET)
        if searchForm.is_valid():
            s = searchForm.cleaned_data['search']
            if errorModels is not None: # search errors only
                cset = [
                    (
                        ul.lesson.title,
                        get_object_url(request.path, ul),
------>                 ul # here was no ul, so cset was a list of tuples with 2 elements
                    )
                    for ul in UnitLesson.search_text(s, IS_ERROR)
                ]

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

4 participants