docassemble.AssemblyLine 3.4.0__tar.gz → 3.5.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. {docassemble_assemblyline-3.4.0/docassemble.AssemblyLine.egg-info → docassemble_assemblyline-3.5.0}/PKG-INFO +1 -1
  2. docassemble_assemblyline-3.5.0/docassemble/AssemblyLine/__init__.py +1 -0
  3. {docassemble_assemblyline-3.4.0 → docassemble_assemblyline-3.5.0}/docassemble/AssemblyLine/al_general.py +84 -6
  4. {docassemble_assemblyline-3.4.0 → docassemble_assemblyline-3.5.0}/docassemble/AssemblyLine/sessions.py +2 -2
  5. {docassemble_assemblyline-3.4.0 → docassemble_assemblyline-3.5.0}/docassemble/AssemblyLine/test_al_general.py +25 -0
  6. {docassemble_assemblyline-3.4.0 → docassemble_assemblyline-3.5.0/docassemble.AssemblyLine.egg-info}/PKG-INFO +1 -1
  7. {docassemble_assemblyline-3.4.0 → docassemble_assemblyline-3.5.0}/setup.py +1 -1
  8. docassemble_assemblyline-3.4.0/docassemble/AssemblyLine/__init__.py +0 -1
  9. {docassemble_assemblyline-3.4.0 → docassemble_assemblyline-3.5.0}/LICENSE +0 -0
  10. {docassemble_assemblyline-3.4.0 → docassemble_assemblyline-3.5.0}/MANIFEST.in +0 -0
  11. {docassemble_assemblyline-3.4.0 → docassemble_assemblyline-3.5.0}/README.md +0 -0
  12. {docassemble_assemblyline-3.4.0 → docassemble_assemblyline-3.5.0}/docassemble/AssemblyLine/al_courts.py +0 -0
  13. {docassemble_assemblyline-3.4.0 → docassemble_assemblyline-3.5.0}/docassemble/AssemblyLine/al_document.py +0 -0
  14. {docassemble_assemblyline-3.4.0 → docassemble_assemblyline-3.5.0}/docassemble/AssemblyLine/custom_jinja_filters.py +0 -0
  15. {docassemble_assemblyline-3.4.0 → docassemble_assemblyline-3.5.0}/docassemble/AssemblyLine/data/questions/al_code.yml +0 -0
  16. {docassemble_assemblyline-3.4.0 → docassemble_assemblyline-3.5.0}/docassemble/AssemblyLine/data/questions/al_document.yml +0 -0
  17. {docassemble_assemblyline-3.4.0 → docassemble_assemblyline-3.5.0}/docassemble/AssemblyLine/data/questions/al_language.yml +0 -0
  18. {docassemble_assemblyline-3.4.0 → docassemble_assemblyline-3.5.0}/docassemble/AssemblyLine/data/questions/al_package.yml +0 -0
  19. {docassemble_assemblyline-3.4.0 → docassemble_assemblyline-3.5.0}/docassemble/AssemblyLine/data/questions/al_package_unstyled.yml +0 -0
  20. {docassemble_assemblyline-3.4.0 → docassemble_assemblyline-3.5.0}/docassemble/AssemblyLine/data/questions/al_question_test.yml +0 -0
  21. {docassemble_assemblyline-3.4.0 → docassemble_assemblyline-3.5.0}/docassemble/AssemblyLine/data/questions/al_reminders.yml +0 -0
  22. {docassemble_assemblyline-3.4.0 → docassemble_assemblyline-3.5.0}/docassemble/AssemblyLine/data/questions/al_saved_sessions.yml +0 -0
  23. {docassemble_assemblyline-3.4.0 → docassemble_assemblyline-3.5.0}/docassemble/AssemblyLine/data/questions/al_saved_sessions_store.yml +0 -0
  24. {docassemble_assemblyline-3.4.0 → docassemble_assemblyline-3.5.0}/docassemble/AssemblyLine/data/questions/al_settings.yml +0 -0
  25. {docassemble_assemblyline-3.4.0 → docassemble_assemblyline-3.5.0}/docassemble/AssemblyLine/data/questions/al_terms_of_use.yml +0 -0
  26. {docassemble_assemblyline-3.4.0 → docassemble_assemblyline-3.5.0}/docassemble/AssemblyLine/data/questions/al_visual.yml +0 -0
  27. {docassemble_assemblyline-3.4.0 → docassemble_assemblyline-3.5.0}/docassemble/AssemblyLine/data/questions/assembly_line.yml +0 -0
  28. {docassemble_assemblyline-3.4.0 → docassemble_assemblyline-3.5.0}/docassemble/AssemblyLine/data/questions/assembly_line_unstyled.yml +0 -0
  29. {docassemble_assemblyline-3.4.0 → docassemble_assemblyline-3.5.0}/docassemble/AssemblyLine/data/questions/demo_search_sessions.yml +0 -0
  30. {docassemble_assemblyline-3.4.0 → docassemble_assemblyline-3.5.0}/docassemble/AssemblyLine/data/questions/feedback.yml +0 -0
  31. {docassemble_assemblyline-3.4.0 → docassemble_assemblyline-3.5.0}/docassemble/AssemblyLine/data/questions/interview_list.yml +0 -0
  32. {docassemble_assemblyline-3.4.0 → docassemble_assemblyline-3.5.0}/docassemble/AssemblyLine/data/questions/ql_baseline.yml +0 -0
  33. {docassemble_assemblyline-3.4.0 → docassemble_assemblyline-3.5.0}/docassemble/AssemblyLine/data/questions/ql_catchall.yml +0 -0
  34. {docassemble_assemblyline-3.4.0 → docassemble_assemblyline-3.5.0}/docassemble/AssemblyLine/data/questions/ql_namechange.yml +0 -0
  35. {docassemble_assemblyline-3.4.0 → docassemble_assemblyline-3.5.0}/docassemble/AssemblyLine/data/questions/reserved_words.yml +0 -0
  36. {docassemble_assemblyline-3.4.0 → docassemble_assemblyline-3.5.0}/docassemble/AssemblyLine/data/questions/test_al_table_document.yml +0 -0
  37. {docassemble_assemblyline-3.4.0 → docassemble_assemblyline-3.5.0}/docassemble/AssemblyLine/data/questions/test_aladdendum.yml +0 -0
  38. {docassemble_assemblyline-3.4.0 → docassemble_assemblyline-3.5.0}/docassemble/AssemblyLine/data/questions/test_alcourts.yml +0 -0
  39. {docassemble_assemblyline-3.4.0 → docassemble_assemblyline-3.5.0}/docassemble/AssemblyLine/data/questions/test_aldocument.yml +0 -0
  40. {docassemble_assemblyline-3.4.0 → docassemble_assemblyline-3.5.0}/docassemble/AssemblyLine/data/questions/test_aldocument_background_assembly.yml +0 -0
  41. {docassemble_assemblyline-3.4.0 → docassemble_assemblyline-3.5.0}/docassemble/AssemblyLine/data/questions/test_alexhibit.yml +0 -0
  42. {docassemble_assemblyline-3.4.0 → docassemble_assemblyline-3.5.0}/docassemble/AssemblyLine/data/questions/test_alexhibit_maxsize.yml +0 -0
  43. {docassemble_assemblyline-3.4.0 → docassemble_assemblyline-3.5.0}/docassemble/AssemblyLine/data/questions/test_bundle_parity.yml +0 -0
  44. {docassemble_assemblyline-3.4.0 → docassemble_assemblyline-3.5.0}/docassemble/AssemblyLine/data/questions/test_familiar_disambiguation.yml +0 -0
  45. {docassemble_assemblyline-3.4.0 → docassemble_assemblyline-3.5.0}/docassemble/AssemblyLine/data/questions/test_question_library.yml +0 -0
  46. {docassemble_assemblyline-3.4.0 → docassemble_assemblyline-3.5.0}/docassemble/AssemblyLine/data/questions/test_signature.yml +0 -0
  47. {docassemble_assemblyline-3.4.0 → docassemble_assemblyline-3.5.0}/docassemble/AssemblyLine/data/sources/README.md +0 -0
  48. {docassemble_assemblyline-3.4.0 → docassemble_assemblyline-3.5.0}/docassemble/AssemblyLine/data/sources/es-words.yml +0 -0
  49. {docassemble_assemblyline-3.4.0 → docassemble_assemblyline-3.5.0}/docassemble/AssemblyLine/data/sources/languages.yml +0 -0
  50. {docassemble_assemblyline-3.4.0 → docassemble_assemblyline-3.5.0}/docassemble/AssemblyLine/data/sources/test_aldocument.feature +0 -0
  51. {docassemble_assemblyline-3.4.0 → docassemble_assemblyline-3.5.0}/docassemble/AssemblyLine/data/sources/test_alexhibit_docx_1.docx +0 -0
  52. {docassemble_assemblyline-3.4.0 → docassemble_assemblyline-3.5.0}/docassemble/AssemblyLine/data/sources/test_alexhibit_jpg_1.jpg +0 -0
  53. {docassemble_assemblyline-3.4.0 → docassemble_assemblyline-3.5.0}/docassemble/AssemblyLine/data/sources/test_alexhibit_pdf_1.pdf +0 -0
  54. {docassemble_assemblyline-3.4.0 → docassemble_assemblyline-3.5.0}/docassemble/AssemblyLine/data/sources/test_alexhibit_png_1.png +0 -0
  55. {docassemble_assemblyline-3.4.0 → docassemble_assemblyline-3.5.0}/docassemble/AssemblyLine/data/sources/test_question_library.feature +0 -0
  56. {docassemble_assemblyline-3.4.0 → docassemble_assemblyline-3.5.0}/docassemble/AssemblyLine/data/sources/translation_es.xlsx +0 -0
  57. {docassemble_assemblyline-3.4.0 → docassemble_assemblyline-3.5.0}/docassemble/AssemblyLine/data/sources/translation_ht.xlsx +0 -0
  58. {docassemble_assemblyline-3.4.0 → docassemble_assemblyline-3.5.0}/docassemble/AssemblyLine/data/sources/translation_pt.xlsx +0 -0
  59. {docassemble_assemblyline-3.4.0 → docassemble_assemblyline-3.5.0}/docassemble/AssemblyLine/data/static/README.md +0 -0
  60. {docassemble_assemblyline-3.4.0 → docassemble_assemblyline-3.5.0}/docassemble/AssemblyLine/data/static/al_audio.css +0 -0
  61. {docassemble_assemblyline-3.4.0 → docassemble_assemblyline-3.5.0}/docassemble/AssemblyLine/data/static/al_audio.js +0 -0
  62. {docassemble_assemblyline-3.4.0 → docassemble_assemblyline-3.5.0}/docassemble/AssemblyLine/data/static/aldocument.css +0 -0
  63. {docassemble_assemblyline-3.4.0 → docassemble_assemblyline-3.5.0}/docassemble/AssemblyLine/data/static/aldocument.js +0 -0
  64. {docassemble_assemblyline-3.4.0 → docassemble_assemblyline-3.5.0}/docassemble/AssemblyLine/data/static/interview_list.css +0 -0
  65. {docassemble_assemblyline-3.4.0 → docassemble_assemblyline-3.5.0}/docassemble/AssemblyLine/data/static/limit_upload_size.js +0 -0
  66. {docassemble_assemblyline-3.4.0 → docassemble_assemblyline-3.5.0}/docassemble/AssemblyLine/data/static/lt1-pullout-10-getting-organized.pdf +0 -0
  67. {docassemble_assemblyline-3.4.0 → docassemble_assemblyline-3.5.0}/docassemble/AssemblyLine/data/static/ma_logo.png +0 -0
  68. {docassemble_assemblyline-3.4.0 → docassemble_assemblyline-3.5.0}/docassemble/AssemblyLine/data/static/placeholder.png +0 -0
  69. {docassemble_assemblyline-3.4.0 → docassemble_assemblyline-3.5.0}/docassemble/AssemblyLine/data/static/seal.jpg +0 -0
  70. {docassemble_assemblyline-3.4.0 → docassemble_assemblyline-3.5.0}/docassemble/AssemblyLine/data/static/styles.css +0 -0
  71. {docassemble_assemblyline-3.4.0 → docassemble_assemblyline-3.5.0}/docassemble/AssemblyLine/data/templates/README.md +0 -0
  72. {docassemble_assemblyline-3.4.0 → docassemble_assemblyline-3.5.0}/docassemble/AssemblyLine/data/templates/al_basic_addendum.docx +0 -0
  73. {docassemble_assemblyline-3.4.0 → docassemble_assemblyline-3.5.0}/docassemble/AssemblyLine/data/templates/exhibit_cover_sheet.docx +0 -0
  74. {docassemble_assemblyline-3.4.0 → docassemble_assemblyline-3.5.0}/docassemble/AssemblyLine/data/templates/exhibit_table_of_contents.docx +0 -0
  75. {docassemble_assemblyline-3.4.0 → docassemble_assemblyline-3.5.0}/docassemble/AssemblyLine/data/templates/general_cover_sheet.docx +0 -0
  76. {docassemble_assemblyline-3.4.0 → docassemble_assemblyline-3.5.0}/docassemble/AssemblyLine/data/templates/sample_word_template.docx +0 -0
  77. {docassemble_assemblyline-3.4.0 → docassemble_assemblyline-3.5.0}/docassemble/AssemblyLine/data/templates/test_aldocument_docx_1.docx +0 -0
  78. {docassemble_assemblyline-3.4.0 → docassemble_assemblyline-3.5.0}/docassemble/AssemblyLine/data/templates/test_aldocument_pdf_1.pdf +0 -0
  79. {docassemble_assemblyline-3.4.0 → docassemble_assemblyline-3.5.0}/docassemble/AssemblyLine/language.py +0 -0
  80. {docassemble_assemblyline-3.4.0 → docassemble_assemblyline-3.5.0}/docassemble/AssemblyLine/project_maintenance.py +0 -0
  81. {docassemble_assemblyline-3.4.0 → docassemble_assemblyline-3.5.0}/docassemble/AssemblyLine/py.typed +0 -0
  82. {docassemble_assemblyline-3.4.0 → docassemble_assemblyline-3.5.0}/docassemble/AssemblyLine/requirements.txt +0 -0
  83. {docassemble_assemblyline-3.4.0 → docassemble_assemblyline-3.5.0}/docassemble/AssemblyLine/sign.py +0 -0
  84. {docassemble_assemblyline-3.4.0 → docassemble_assemblyline-3.5.0}/docassemble/AssemblyLine/test_al_document.py +0 -0
  85. {docassemble_assemblyline-3.4.0 → docassemble_assemblyline-3.5.0}/docassemble/AssemblyLine/test_language.py +0 -0
  86. {docassemble_assemblyline-3.4.0 → docassemble_assemblyline-3.5.0}/docassemble/__init__.py +0 -0
  87. {docassemble_assemblyline-3.4.0 → docassemble_assemblyline-3.5.0}/docassemble.AssemblyLine.egg-info/SOURCES.txt +0 -0
  88. {docassemble_assemblyline-3.4.0 → docassemble_assemblyline-3.5.0}/docassemble.AssemblyLine.egg-info/dependency_links.txt +0 -0
  89. {docassemble_assemblyline-3.4.0 → docassemble_assemblyline-3.5.0}/docassemble.AssemblyLine.egg-info/not-zip-safe +0 -0
  90. {docassemble_assemblyline-3.4.0 → docassemble_assemblyline-3.5.0}/docassemble.AssemblyLine.egg-info/requires.txt +0 -0
  91. {docassemble_assemblyline-3.4.0 → docassemble_assemblyline-3.5.0}/docassemble.AssemblyLine.egg-info/top_level.txt +0 -0
  92. {docassemble_assemblyline-3.4.0 → docassemble_assemblyline-3.5.0}/pyproject.toml +0 -0
  93. {docassemble_assemblyline-3.4.0 → docassemble_assemblyline-3.5.0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: docassemble.AssemblyLine
3
- Version: 3.4.0
3
+ Version: 3.5.0
4
4
  Home-page: https://courtformsonline.org
5
5
  Author: Suffolk Legal Innovation and Technology Lab
6
6
  Author-email: qsteenhuis@suffolk.edu
@@ -0,0 +1 @@
1
+ __version__ = '3.5.0'
@@ -116,6 +116,7 @@ class ALAddress(Address):
116
116
  allow_no_address: bool = False,
117
117
  ask_if_impounded: Optional[bool] = False,
118
118
  maxlengths: Optional[Dict[str, int]] = None,
119
+ required: Optional[Dict[str, bool]] = None,
119
120
  ) -> List[Dict[str, Any]]:
120
121
  """
121
122
  Return a YAML structure representing the list of fields for the object's address.
@@ -136,6 +137,7 @@ class ALAddress(Address):
136
137
  allow_no_address (bool): Allow users to specify they don't have an address. Defaults to False.
137
138
  ask_if_impounded (Optional[bool]): Whether to ask if the address is impounded. Defaults to False.
138
139
  maxlengths (Optional[Dict[str, int]]): A dictionary of field names and their maximum lengths. Defaults to None.
140
+ required (Dict[str, bool], optional): A dictionary of field names and if they should be required. Default is None (everything but unit and zip is required)
139
141
 
140
142
  Returns:
141
143
  List[Dict[str, Any]]: A list of dictionaries representing address fields.
@@ -277,6 +279,11 @@ class ALAddress(Address):
277
279
  if field["field"] in maxlengths:
278
280
  field["maxlength"] = maxlengths[field["field"]]
279
281
 
282
+ if required:
283
+ for field in fields:
284
+ if field["field"] in required:
285
+ field["required"] = required[field["field"]]
286
+
280
287
  return fields
281
288
 
282
289
  def formatted_unit(
@@ -819,7 +826,14 @@ class ALPeopleList(DAList):
819
826
  str: Formatted string of full names.
820
827
  """
821
828
  return comma_and_list(
822
- [person.name.full(middle="full") for person in self],
829
+ [
830
+ (
831
+ person.name_full()
832
+ if isinstance(person, ALIndividual)
833
+ else person.name.full(middle="full")
834
+ )
835
+ for person in self
836
+ ],
823
837
  comma_string=comma_string,
824
838
  and_string=and_string,
825
839
  )
@@ -1234,6 +1248,7 @@ class ALIndividual(Individual):
1234
1248
  allow_no_address: bool = False,
1235
1249
  ask_if_impounded: bool = False,
1236
1250
  maxlengths: Optional[Dict[str, int]] = None,
1251
+ required: Optional[Dict[str, bool]] = None,
1237
1252
  ) -> List[Dict[str, str]]:
1238
1253
  """
1239
1254
  Generate field prompts for capturing an address.
@@ -1247,6 +1262,7 @@ class ALIndividual(Individual):
1247
1262
  allow_no_address (bool): Whether to permit entries with no address. Defaults to False.
1248
1263
  ask_if_impounded (bool): Whether to ask if the address is impounded. Defaults to False.
1249
1264
  maxlengths (Dict[str, int], optional): A dictionary of field names and their maximum lengths. Default is None.
1265
+ required (Dict[str, bool], optional): A dictionary of field names and if they should be required. Default is None (everything but unit and zip is required)
1250
1266
 
1251
1267
  Returns:
1252
1268
  List[Dict[str, str]]: A list of dictionaries with field prompts for addresses.
@@ -1262,6 +1278,7 @@ class ALIndividual(Individual):
1262
1278
  allow_no_address=allow_no_address,
1263
1279
  ask_if_impounded=ask_if_impounded,
1264
1280
  maxlengths=maxlengths,
1281
+ required=required,
1265
1282
  )
1266
1283
 
1267
1284
  def gender_fields(
@@ -1604,8 +1621,9 @@ class ALIndividual(Individual):
1604
1621
  else:
1605
1622
  if isinstance(self.address, ALAddress):
1606
1623
  return (
1607
- "[FLUSHLEFT] "
1608
- + self.name.full()
1624
+ "[FLUSHLEFT] " + self.name_full()
1625
+ if isinstance(self, ALIndividual)
1626
+ else self.name.full(middle="full")
1609
1627
  + " [NEWLINE] "
1610
1628
  + self.address.block(
1611
1629
  language=language,
@@ -1617,8 +1635,9 @@ class ALIndividual(Individual):
1617
1635
  )
1618
1636
  else:
1619
1637
  return (
1620
- "[FLUSHLEFT] "
1621
- + self.name.full()
1638
+ "[FLUSHLEFT] " + self.name_full()
1639
+ if isinstance(self, ALIndividual)
1640
+ else self.name.full(middle="full")
1622
1641
  + " [NEWLINE] "
1623
1642
  + self.address.block(
1624
1643
  language=language,
@@ -2003,9 +2022,18 @@ class ALIndividual(Individual):
2003
2022
  def name_full(self) -> str:
2004
2023
  """Returns the individual's full name.
2005
2024
 
2025
+ If the person has the attribute person_type and it is defined
2026
+ as either `business` or `organization`, it will only return
2027
+ the first name, even if middle, last, or suffix are defined.
2028
+
2006
2029
  Returns:
2007
- str: The individual's full name.
2030
+ str: The individual or business's full name.
2008
2031
  """
2032
+ if hasattr(self, "person_type") and self.person_type in [
2033
+ "business",
2034
+ "organization",
2035
+ ]:
2036
+ return self.name.first
2009
2037
  return self.name.full(middle="full")
2010
2038
 
2011
2039
  def name_initials(self) -> str:
@@ -2014,9 +2042,18 @@ class ALIndividual(Individual):
2014
2042
  Equivalent to `name.full(middle="initial")`, which is also the default.
2015
2043
  Defined only to make it possible to be explicit about the name form.
2016
2044
 
2045
+ If the person has the attribute person_type and it is defined
2046
+ as either `business` or `organization`, it will only return
2047
+ the "initials" of the first name, even if middle, last, or suffix are defined.
2048
+
2017
2049
  Returns:
2018
2050
  str: The individual's name with the middle name as an initial.
2019
2051
  """
2052
+ if hasattr(self, "person_type") and self.person_type in [
2053
+ "business",
2054
+ "organization",
2055
+ ]:
2056
+ return self.name.first
2020
2057
  return self.name.full(middle="initial")
2021
2058
 
2022
2059
  def name_short(self) -> str:
@@ -2025,9 +2062,18 @@ class ALIndividual(Individual):
2025
2062
 
2026
2063
  Equivalent to self.name.firstlast()
2027
2064
 
2065
+ If the person has the attribute person_type and it is defined
2066
+ as either `business` or `organization`, it will only return
2067
+ the first name, even if middle, last, or suffix are defined.
2068
+
2028
2069
  Returns:
2029
2070
  str: The individual'
2030
2071
  """
2072
+ if hasattr(self, "person_type") and self.person_type in [
2073
+ "business",
2074
+ "organization",
2075
+ ]:
2076
+ return self.name.first
2031
2077
  return self.name.firstlast()
2032
2078
 
2033
2079
  def familiar(
@@ -2051,6 +2097,10 @@ class ALIndividual(Individual):
2051
2097
  * the default value, e.g., "the minor", if provided
2052
2098
  * the full name
2053
2099
 
2100
+ If the person has the attribute `person_type` and it is defined
2101
+ as either `business` or `organization`, it will only return
2102
+ the first name, even if middle, last, or suffix are defined.
2103
+
2054
2104
  Args:
2055
2105
  unique_names (Optional[List[Any]]): A list of unique names to compare against. Defaults to None.
2056
2106
  default (Optional[str]): The default name to return if no unique name is found. Defaults to None.
@@ -2063,6 +2113,12 @@ class ALIndividual(Individual):
2063
2113
  Who do you want to take care of ${ children.familiar(unique_names=parents + petitioners, default="the minor") }
2064
2114
  ```
2065
2115
  """
2116
+ if hasattr(self, "person_type") and self.person_type in [
2117
+ "business",
2118
+ "organization",
2119
+ ]:
2120
+ return self.name.first
2121
+
2066
2122
  if unique_names is None:
2067
2123
  unique_names = []
2068
2124
 
@@ -2113,6 +2169,28 @@ class ALIndividual(Individual):
2113
2169
  return default
2114
2170
  return self.name_full() # We tried but couldn't disambiguate
2115
2171
 
2172
+ def __str__(self) -> str:
2173
+ """
2174
+ Returns a string representation of the individual, which is their full name with the
2175
+ middle name shortened to one letter.
2176
+
2177
+ If the individual has the attribute `person_type` and it is defined
2178
+ as either `business` or `organization`, it will only return
2179
+ the first name, even if middle, last, or suffix are defined.
2180
+
2181
+ Returns:
2182
+ str: The individual's name.
2183
+ """
2184
+ if hasattr(self, "person_type") and self.person_type in [
2185
+ "business",
2186
+ "organization",
2187
+ ]:
2188
+ return self.name.first
2189
+
2190
+ return (
2191
+ super().__str__()
2192
+ ) # This will call the parent's __str__ method, which returns the full name with middle initial
2193
+
2116
2194
 
2117
2195
  # (DANav isn't in public DA API, but currently in functions.py)
2118
2196
  def section_links(nav) -> List[str]: # type: ignore
@@ -1614,7 +1614,7 @@ def get_filenames_having_sessions(
1614
1614
  conn = variables_snapshot_connection()
1615
1615
  if user_id is None:
1616
1616
  if user_logged_in():
1617
- user_id = current_context().id
1617
+ user_id = user_info().id
1618
1618
  else:
1619
1619
  log("Asked to get interview list for user that is not logged in")
1620
1620
  return []
@@ -1623,7 +1623,7 @@ def get_filenames_having_sessions(
1623
1623
  if user_has_privilege(global_search_allowed_roles):
1624
1624
  user_id = None
1625
1625
  elif user_logged_in():
1626
- user_id = current_context().id
1626
+ user_id = user_info().id
1627
1627
  log(
1628
1628
  f"User {user_info().email} does not have permission to list interview sessions belonging to other users"
1629
1629
  )
@@ -12,6 +12,23 @@ class test_aladdress(unittest.TestCase):
12
12
  addr = ALAddress(address="", city="")
13
13
  self.assertEqual(addr.on_one_line(), "")
14
14
 
15
+ def test_address_required(self):
16
+ addr = ALAddress(
17
+ address_label="address",
18
+ unit_label="unit",
19
+ city_label="city",
20
+ state_label="state",
21
+ zip_label="zip",
22
+ )
23
+ fields = addr.address_fields(required={"zip": True})
24
+ for field in fields:
25
+ if field["field"] == "zip":
26
+ self.assertTrue(field["required"])
27
+ fields = addr.address_fields()
28
+ for field in fields:
29
+ if field["field"] == "zip":
30
+ self.assertFalse(field["required"])
31
+
15
32
  def test_no_unit_floor_room(self):
16
33
  self.assertFalse(hasattr(self.addr, "unit"))
17
34
  self.assertFalse(hasattr(self.addr, "floor"))
@@ -436,6 +453,14 @@ class TestALIndividual(unittest.TestCase):
436
453
  self.assertEqual(self.individual.name_initials(), "John J. Jingleheimer")
437
454
  self.assertEqual(self.individual.name_short(), "John Jingleheimer")
438
455
 
456
+ self.individual.person_type = "business"
457
+ self.individual.name.first = "Johnny's Sandwiches"
458
+
459
+ self.assertEqual(self.individual.name_full(), "Johnny's Sandwiches")
460
+ self.assertEqual(self.individual.name_initials(), "Johnny's Sandwiches")
461
+ self.assertEqual(self.individual.name_short(), "Johnny's Sandwiches")
462
+ self.assertEqual(str(self.individual), "Johnny's Sandwiches")
463
+
439
464
 
440
465
  class test_get_visible_al_nav_items(unittest.TestCase):
441
466
  def test_case_1(self):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: docassemble.AssemblyLine
3
- Version: 3.4.0
3
+ Version: 3.5.0
4
4
  Home-page: https://courtformsonline.org
5
5
  Author: Suffolk Legal Innovation and Technology Lab
6
6
  Author-email: qsteenhuis@suffolk.edu
@@ -44,7 +44,7 @@ def find_package_data(where='.', package='', exclude=standard_exclude, exclude_d
44
44
  return out
45
45
 
46
46
  setup(name='docassemble.AssemblyLine',
47
- version='3.4.0',
47
+ version='3.5.0',
48
48
  description=(''),
49
49
  long_description='# Suffolk LIT Lab Document Assembly Line\r\n\r\n[![PyPI version](https://badge.fury.io/py/docassemble-AssemblyLine.svg)](https://badge.fury.io/py/docassemble-AssemblyLine)\r\n\r\n<img src="https://user-images.githubusercontent.com/7645641/142245862-c2eb02ab-3090-4e97-9653-bb700bf4c54d.png" alt="drawing" width="300" alt="work together" style="align: center;"/>\r\n\r\nThe Assembly Line Project is a collection of volunteers, students, and institutions who joined together\r\nduring the COVID-19 pandemic to help increase access to the court system. Our vision is mobile-friendly,\r\neasy to use **guided** online forms that help empower litigants to access the court remotely.\r\n\r\nOur signature project is [CourtFormsOnline.org](https://courtformsonline.org).\r\n\r\nWe designed a step-by-step, assembly line style process for automating court forms on top of Docassemble\r\nand built several tools along the way that **you** can use in your home jurisdiction.\r\n\r\nThis package contains **runtime code** and **pre-written questions** to support authoring robust, \r\nconsistent, and attractive Docassemble interviews that help complete court forms.\r\n\r\nRead more on our [documentation page](https://suffolklitlab.org/docassemble-AssemblyLine-documentation/).\r\n\r\n\r\n# Related repositories\r\n\r\n* https://github.com/SuffolkLitLab/docassemble-ALWeaver\r\n* https://github.com/SuffolkLitLab/docassemble-ALMassachusetts\r\n* https://github.com/SuffolkLitLab/docassemble-MassAccess\r\n* https://github.com/SuffolkLitLab/docassemble-ALThemeTemplate\r\n* https://github.com/SuffolkLitLab/EfileProxyServer\r\n\r\n# Documentation\r\n\r\nhttps://suffolklitlab.org/docassemble-AssemblyLine-documentation/\r\n\r\n# Installation\r\n\r\n## Menu-driven installation\r\n\r\nThe recommended installation method is with the [guided installation script](https://suffolklitlab.org/docassemble-AssemblyLine-documentation/docs/installation).\r\n\r\n## Manual installation\r\n\r\nNormally you do not need to manually install the Assembly Line. Use the [installation script](https://suffolklitlab.org/docassemble-AssemblyLine-documentation/docs/installation)\r\nif you can. The instructions below are for your optional reference.\r\n\r\nThis package depends on the following configuration changes on your Docassemble server:\r\n\r\n* Ensure that [font-awesome](https://docassemble.org/docs/config.html#default%20icons) is enabled (this may be on by default:\r\n```yaml\r\ndefault icons: font awesome\r\n```\r\n* Add a [Google API key](https://docassemble.org/docs/config.html#google) that has access to:\r\n * Google Places API\r\n * Google Geocoding API\r\n* Add a [VoiceRSS API key](https://docassemble.org/docs/config.html#voicerss)\r\n* Add a [Twilio API key](https://docassemble.org/docs/config.html#twilio) for SMS support\r\n* Add an email account: [Mailgun](https://docassemble.org/docs/config.html#mailgun%20api) or [SendGrid](https://docassemble.org/docs/config.html#sendgrid%20api) recommended for email support\r\n* To show package update time and to enable the feedback form, add a GitHub Private Access token to your config.yml file, like this:\r\n```yaml\r\n# Needs access to create new issues on repositories\r\ngithub issues:\r\n username: "suffolklitlab-issues"\r\n token: "12345"\r\n# Does not need any special access to public repositories \r\ngithub readonly:\r\n username: "suffolklitlab-issues"\r\n password: "45678"\r\n type: "basic"\r\n```\r\n* If you are also using the [Assembly Line Weaver](https://github.com/SuffolkLITLab/docassemble-assemblylinewizard), you may want to set up a [Docassemble API key](https://docassemble.org/docs/api.html#manage_api) in your config.yml file to allow you to install packages automatically, like this:\r\n```yaml\r\ninstall packages api key: 12345\r\n```\r\n\r\n# Migration\r\n\r\nSee [discussion here](https://github.com/SuffolkLITLab/docassemble-AssemblyLine/issues/69)\r\n\r\n\r\n# ALDocument class\r\n\r\n## Purpose\r\n\r\nThe ALDocument class is a small utility library that makes it simpler to use the following features in an interview:\r\n\r\n* Conditional assembly of multiple, optional documents that are triggered in different ways in your interview\r\n* An addendum for PDF files that makes it simple to deal with overflow text\r\n* A customizable download screen that lists the documents in a neat table\r\n* A customizable "send" button that allows the user to email the final forms to a location of their choice\r\n\r\nHere is a small snippet that you can copy and modify that shows how to use the most important features of the ALDocument class.\r\n\r\n```\r\n---\r\nobjects:\r\n - CRA_Motion_to_Dismiss_attachment: ALDocument.using(filename="CRA_Motion_to_Dismiss", title="Motion to Dismiss CRA", enabled=True, has_addendum=True, default_overflow_message="[See addendum]") \r\n---\r\nobjects:\r\n - al_user_bundle: ALDocumentBundle.using(elements=[CRA_Motion_to_Dismiss_attachment], title="Forms to download and deliver to court", filename="motion_to_dismiss_CRA.pdf")\r\n - al_court_bundle: ALDocumentBundle.using(elements=[CRA_Motion_to_Dismiss_attachment], title="Forms to download and deliver to court", filename="motion_to_dismiss_CRA.pdf")\r\n---\r\ngeneric object: ALDocument\r\nattachment:\r\n variable name: x.addendum\r\n docx template file: docx_addendum.docx\r\n---\r\ncode: |\r\n CRA_Motion_to_Dismiss_attachment.overflow_fields[\'reasons_for_request\'].overflow_trigger = 640\r\n CRA_Motion_to_Dismiss_attachment.overflow_fields[\'reasons_for_request\'].label = "Reasons for request"\r\n CRA_Motion_to_Dismiss_attachment.overflow_fields.gathered = True\r\n \r\n---\r\nattachment:\r\n variable name: CRA_Motion_to_Dismiss_attachment[i]\r\n name: CRA Motion to Dismiss\r\n filename: CRA_Motion_to_Dismiss\r\n skip undefined: True\r\n pdf template file: CRA_Motion_to_Dismiss.pdf\r\n fields: \r\n - "court_county": ${ trial_court.address.county }\r\n - "docket_number": ${ docket_number }\r\n - "user_signature": ${ users[0].signature_if_final(i) }\r\n - "signature_date": ${ signature_date }\r\n```\r\n\r\nIt is very common to have a *contingent* document in ALDocument. If your document is contingent, remove the `enabled=True` from the object declaration, and use\r\nsome other method to "turn on" the attachment.\r\n\r\nE.g.,\r\n\r\n```\r\ncode: |\r\n CRA_Motion_to_Dismiss_attachment.enabled = condition1 and condition2\r\n```\r\n\r\n# Changelog\r\n\r\nSee [CHANGELOG.MD](https://github.com/SuffolkLITLab/docassemble-AssemblyLine/blob/main/CHANGELOG.md)\r\n',
50
50
  long_description_content_type='text/markdown',
@@ -1 +0,0 @@
1
- __version__ = '3.4.0'