Skip to content

Commit 1316ff8

Browse files
committed
style: remove "then True else False" pattern
1 parent 69de070 commit 1316ff8

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/webview/subscriptions/views.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -155,10 +155,7 @@ def post(self, request: HttpRequest) -> HttpResponse:
155155

156156
profile = request.user.profile
157157

158-
if action == "enable":
159-
profile.auto_subscribe_to_maintained_packages = True
160-
else: # disable
161-
profile.auto_subscribe_to_maintained_packages = False
158+
profile.auto_subscribe_to_maintained_packages = action == "enable"
162159

163160
profile.save(update_fields=["auto_subscribe_to_maintained_packages"])
164161

0 commit comments

Comments
 (0)