Skip to content

Changes ternary conditionals to be PEP308 compliant #5827

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

Merged
merged 1 commit into from
Feb 14, 2018
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
4 changes: 2 additions & 2 deletions docs/tutorial/4-authentication-and-permissions.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ And now we can add a `.save()` method to our model class:
representation of the code snippet.
"""
lexer = get_lexer_by_name(self.language)
linenos = self.linenos and 'table' or False
options = self.title and {'title': self.title} or {}
linenos = 'table' if self.linenos else False
options = {'title': self.title} if self.title else {}
formatter = HtmlFormatter(style=self.style, linenos=linenos,
full=True, **options)
self.highlighted = highlight(self.code, lexer, formatter)
Expand Down
2 changes: 1 addition & 1 deletion rest_framework/routers.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ class SimpleRouter(BaseRouter):
]

def __init__(self, trailing_slash=True):
self.trailing_slash = trailing_slash and '/' or ''
self.trailing_slash = '/' if trailing_slash else ''
super(SimpleRouter, self).__init__()

def get_default_base_name(self, viewset):
Expand Down