Skip to content

Commit

Permalink
[FIX] base_multi_image: Attribute Error
Browse files Browse the repository at this point in the history
  • Loading branch information
GabbasovDinar committed Jan 17, 2025
1 parent c5af4ed commit 5cd3d28
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions base_multi_image/models/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,10 @@ def _onchange_load_from(self):
# Retrieve from remote url
self.image_1920 = self._get_image_from_url(self.load_from)
filename = self.load_from.split("/")[-1]
self.name, self.extension = os.path.splitext(filename)
self.name = os.path.splitext(filename)[0]

Check warning on line 91 in base_multi_image/models/image.py

View check run for this annotation

Codecov / codecov/patch

base_multi_image/models/image.py#L91

Added line #L91 was not covered by tests
else:
self.image_1920 = self._get_image_from_file(self.load_from)
self.name, self.extension = os.path.splitext(
os.path.basename(self.load_from)
)
self.name = os.path.splitext(os.path.basename(self.load_from))[0]

Check warning on line 94 in base_multi_image/models/image.py

View check run for this annotation

Codecov / codecov/patch

base_multi_image/models/image.py#L94

Added line #L94 was not covered by tests
self.name = self._make_name_pretty(self.name)
self.load_from = False

Expand Down Expand Up @@ -185,5 +183,5 @@ def _make_name_pretty(self, name):
@api.onchange("filename")
def _onchange_filename(self):
if self.filename:
self.name, self.extension = os.path.splitext(self.filename)
self.name = os.path.splitext(self.filename)[0]

Check warning on line 186 in base_multi_image/models/image.py

View check run for this annotation

Codecov / codecov/patch

base_multi_image/models/image.py#L186

Added line #L186 was not covered by tests
self.name = self._make_name_pretty(self.name)

0 comments on commit 5cd3d28

Please sign in to comment.