Skip to content

Commit

Permalink
Bug: resolve update list item entity type (#365)
Browse files Browse the repository at this point in the history
  • Loading branch information
vvgrem@gmail.com authored and vvgrem@gmail.com committed Jul 2, 2021
1 parent e2b089e commit b1e850b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 5 additions & 0 deletions office365/sharepoint/listitems/listitem.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,11 @@ def validate_update_list_item(self, form_values, new_document_update):
self.context.add_query(qry)
return self

def update(self):
self.ensure_type_name(self.parent_list)
super(ListItem, self).update()
return self

def system_update(self):
"""Update the list item."""
qry = ServiceOperationQuery(self,
Expand Down
5 changes: 3 additions & 2 deletions tests/sharepoint/test_field_value.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,9 @@ def test3_create_multi_lookup_field(self):
self.assertEqual(lookup_field.type_as_string, 'LookupMulti')

def test4_set_field_multi_lookup_value(self):
item_to_update = self.__class__.target_item
lookup_id = item_to_update.id
# item_to_update = self.__class__.target_item
item_to_update = self.__class__.target_list.get_item_by_id(self.__class__.target_item.id)
lookup_id = self.__class__.target_item.id
field_value = FieldMultiLookupValue()
field_value.add(FieldLookupValue(lookup_id))
updated = item_to_update.set_property(self.multi_lookup_field_name, field_value).update().get().execute_query()
Expand Down

0 comments on commit b1e850b

Please sign in to comment.