Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed unnecessary "else" statements. #183

Merged
merged 2 commits into from
Oct 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changes/182.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove useless "else" statements.
3 changes: 1 addition & 2 deletions meta/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,7 @@ def process_value(item):
return item(field)
except TypeError:
return item()
else:
return item
return item

if value:
try:
Expand Down
6 changes: 2 additions & 4 deletions meta/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,7 @@ def _normalize_media_url(self, url):
def image(self):
if self.image_object:
return self.image_object.get("url")
else:
return self._image
return self._image

@image.setter
def image(self, image):
Expand Down Expand Up @@ -245,8 +244,7 @@ def process_item(item):
return [process_item(value) for value in item]
elif isinstance(item, dict):
return {itemkey: process_item(itemvalue) for itemkey, itemvalue in item.items()}
else:
return item
return item

schema = {}
# object is immediately set here to recursion
Expand Down
Loading