Skip to content

Commit b1e850b

Browse files
Bug: resolve update list item entity type (#365)
1 parent e2b089e commit b1e850b

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

office365/sharepoint/listitems/listitem.py

+5
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,11 @@ def validate_update_list_item(self, form_values, new_document_update):
145145
self.context.add_query(qry)
146146
return self
147147

148+
def update(self):
149+
self.ensure_type_name(self.parent_list)
150+
super(ListItem, self).update()
151+
return self
152+
148153
def system_update(self):
149154
"""Update the list item."""
150155
qry = ServiceOperationQuery(self,

tests/sharepoint/test_field_value.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,9 @@ def test3_create_multi_lookup_field(self):
6666
self.assertEqual(lookup_field.type_as_string, 'LookupMulti')
6767

6868
def test4_set_field_multi_lookup_value(self):
69-
item_to_update = self.__class__.target_item
70-
lookup_id = item_to_update.id
69+
# item_to_update = self.__class__.target_item
70+
item_to_update = self.__class__.target_list.get_item_by_id(self.__class__.target_item.id)
71+
lookup_id = self.__class__.target_item.id
7172
field_value = FieldMultiLookupValue()
7273
field_value.add(FieldLookupValue(lookup_id))
7374
updated = item_to_update.set_property(self.multi_lookup_field_name, field_value).update().get().execute_query()

0 commit comments

Comments
 (0)