Skip to content

Commit

Permalink
Docsig
Browse files Browse the repository at this point in the history
  • Loading branch information
nonprofittechy committed Sep 21, 2024
1 parent 811e0e9 commit 45a4ff1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docassemble/AssemblyLine/data/questions/interview_list.yml
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ subquestion: |
% endif
% if showifdef("limit_filename") or showifdef("search_keyword"):
${ session_list_html(results_to_format = find_matching_sessions(filenames={limit_filename} if limit_filename else None, keyword=search_keyword), filename=None, limit=20, offset=session_page*20, exclude_filenames=al_sessions_to_exclude_from_interview_list, exclude_newly_started_sessions=True) }
${ session_list_html(answers = find_matching_sessions(filenames={limit_filename} if limit_filename else None, keyword=search_keyword), filename=None, limit=20, offset=session_page*20, exclude_filenames=al_sessions_to_exclude_from_interview_list, exclude_newly_started_sessions=True) }
% else:
${ session_list_html(filename=None, limit=20, offset=session_page*20, exclude_filenames=al_sessions_to_exclude_from_interview_list, exclude_newly_started_sessions=True) }
Expand Down
11 changes: 7 additions & 4 deletions docassemble/AssemblyLine/sessions.py
Original file line number Diff line number Diff line change
Expand Up @@ -991,7 +991,7 @@ def session_list_html(
show_copy_button: bool = True,
limit: int = 50,
offset: int = 0,
results_to_format: Optional[List[Dict[str, Any]]] = None,
answers: Optional[List[Dict[str, Any]]] = None,
) -> str:
"""Return a string containing an HTML-formatted table with the list of user sessions.
While interview_list_html() is for answer sets, this feature is for standard
Expand Down Expand Up @@ -1019,12 +1019,13 @@ def session_list_html(
show_copy_button (bool, optional): If True, show a copy button for answer sets. Defaults to True.
limit (int, optional): Limit for the number of sessions returned. Defaults to 50.
offset (int, optional): Offset for the session list. Defaults to 0.
answers (Optional[List[Dict[str, Any]], optional): A list of answers to format and display. Defaults to showing all sessions for the current user.
Returns:
str: HTML-formatted table containing the list of user sessions.
"""
if not results_to_format:
if not answers:
answers = get_saved_interview_list(
filename=filename,
user_id=user_id,
Expand All @@ -1036,8 +1037,6 @@ def session_list_html(
exclude_filenames=exclude_filenames,
exclude_newly_started_sessions=exclude_newly_started_sessions,
)
else:
answers = results_to_format

if not answers:
return ""
Expand Down Expand Up @@ -1594,7 +1593,11 @@ def config_with_language_fallback(
def get_filenames_having_sessions(
user_id: Optional[Union[int, str]] = None,
global_search_allowed_roles: Optional[Union[Set[str], List[str]]] = None,
<<<<<<< Updated upstream
):
=======
) -> List[str]:
>>>>>>> Stashed changes
"""Get a list of all filenames that have sessions saved for a given user, in order
to help show the user a good list of interviews to filter search results.
Expand Down

0 comments on commit 45a4ff1

Please sign in to comment.