-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🗑️(back) filter search on current lti_context
A user can be part of multiple forums attached to different classes. We want the search to keep is current scope and only search in forums that are related to the course user is actually logged in. Currently, a user can search in all the forums he has access to and it can be a bit confusing. Clicking on a result that lead to another course, connects the user in a different forum from is original search. Results might not be even relevant as context is different than expected. To be more relevant and not to loose our users, we filter results to current LTIContext and only show results from forum of the current class.
- Loading branch information
Showing
4 changed files
with
187 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
""" | ||
Forum search views | ||
================== | ||
This module defines views provided by the ``forum_search`` application. | ||
""" | ||
from haystack import views | ||
|
||
from ashley.context_mixins import get_current_lti_session | ||
|
||
|
||
class FacetedSearchView(views.FacetedSearchView): | ||
"""View to show search results""" | ||
|
||
template = "forum_search/search.html" | ||
|
||
def build_form(self, form_kwargs=None): | ||
form = super().build_form( | ||
form_kwargs={ | ||
"user": self.request.user, | ||
"lti_context": get_current_lti_session(self.request), | ||
} | ||
) | ||
return form |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters