Skip to content

Commit

Permalink
Miscellaneous cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobtylerwalls committed Jan 10, 2025
1 parent 7c76a8a commit d289ee9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion arches/app/models/tile.py
Original file line number Diff line number Diff line change
Expand Up @@ -807,7 +807,7 @@ def __preSave(self, request=None, context=None):
)
logger.warning(e)

def __preDelete(self, request):
def __preDelete(self, request=None):
try:
for function in self._getFunctionClassInstances():
try:
Expand Down
4 changes: 2 additions & 2 deletions arches/app/models/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ def add_to_update_fields(kwargs, field_name):
kwargs["update_fields"] = new


def field_names(instance):
return {f.name for f in instance._meta.fields}
def field_names(instance_or_class):
return {f.name for f in instance_or_class._meta.fields}
3 changes: 2 additions & 1 deletion tests/models/resource_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,8 @@ def test_delete_acts_on_custom_indices(self, mock):
other_resource = Resource(pk=uuid.uuid4())
with sync_overridden_test_settings_to_arches():
self.test_resource.delete_index(other_resource.pk)
self.assertIn(str(other_resource.pk), str(mock._mock_call_args))
# delete_resources() was called with the correct resource id.
self.assertEqual(other_resource.pk, mock._mock_call_args[1]["resources"].pk)

def test_publication_restored_on_save(self):
"""
Expand Down

0 comments on commit d289ee9

Please sign in to comment.