1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Removed unnecessary arguments in .get method calls

This commit is contained in:
Piotr Jakimiak
2015-05-13 20:51:18 +02:00
parent f61c4f490d
commit 4157c502a5
39 changed files with 78 additions and 79 deletions

View File

@@ -1325,7 +1325,7 @@ class Library(object):
# inclusion tags are often used for forms, and we need
# instructions for using CSRF protection to be as simple
# as possible.
csrf_token = context.get('csrf_token', None)
csrf_token = context.get('csrf_token')
if csrf_token is not None:
new_context['csrf_token'] = csrf_token
return t.render(new_context)
@@ -1421,7 +1421,7 @@ def get_library(library_name):
Subsequent loads eg. {% load somelib %} in the same process will grab
the cached module from libraries.
"""
lib = libraries.get(library_name, None)
lib = libraries.get(library_name)
if not lib:
templatetags_modules = get_templatetags_modules()
tried_modules = []

View File

@@ -53,7 +53,7 @@ class CommentNode(Node):
class CsrfTokenNode(Node):
def render(self, context):
csrf_token = context.get('csrf_token', None)
csrf_token = context.get('csrf_token')
if csrf_token:
if csrf_token == 'NOTPROVIDED':
return format_html("")