Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
django
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
django
Commits
8b3f1c35
Kaydet (Commit)
8b3f1c35
authored
Nis 24, 2019
tarafından
Jon Dufresne
Kaydeden (comit)
Mariusz Felisiak
Nis 24, 2019
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Removed unnecessary assignments in various code.
üst
80482e92
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
20 additions
and
33 deletions
+20
-33
options.py
django/contrib/admin/options.py
+1
-2
views.py
django/contrib/flatpages/views.py
+1
-2
errcheck.py
django/contrib/gis/gdal/prototypes/errcheck.py
+1
-2
base.py
django/core/cache/backends/base.py
+1
-2
loaddata.py
django/core/management/commands/loaddata.py
+1
-2
sql.py
django/core/management/sql.py
+1
-2
operations.py
django/db/backends/sqlite3/operations.py
+3
-4
formsets.py
django/forms/formsets.py
+4
-3
multipartparser.py
django/http/multipartparser.py
+1
-2
csrf.py
django/middleware/csrf.py
+1
-2
response.py
django/template/response.py
+1
-2
utils.py
django/test/utils.py
+2
-4
tests.py
tests/logging_tests/tests.py
+1
-2
views.py
tests/test_client_regress/views.py
+1
-2
No files found.
django/contrib/admin/options.py
Dosyayı görüntüle @
8b3f1c35
...
@@ -610,7 +610,7 @@ class ModelAdmin(BaseModelAdmin):
...
@@ -610,7 +610,7 @@ class ModelAdmin(BaseModelAdmin):
info
=
self
.
model
.
_meta
.
app_label
,
self
.
model
.
_meta
.
model_name
info
=
self
.
model
.
_meta
.
app_label
,
self
.
model
.
_meta
.
model_name
urlpatterns
=
[
return
[
path
(
''
,
wrap
(
self
.
changelist_view
),
name
=
'
%
s_
%
s_changelist'
%
info
),
path
(
''
,
wrap
(
self
.
changelist_view
),
name
=
'
%
s_
%
s_changelist'
%
info
),
path
(
'add/'
,
wrap
(
self
.
add_view
),
name
=
'
%
s_
%
s_add'
%
info
),
path
(
'add/'
,
wrap
(
self
.
add_view
),
name
=
'
%
s_
%
s_add'
%
info
),
path
(
'autocomplete/'
,
wrap
(
self
.
autocomplete_view
),
name
=
'
%
s_
%
s_autocomplete'
%
info
),
path
(
'autocomplete/'
,
wrap
(
self
.
autocomplete_view
),
name
=
'
%
s_
%
s_autocomplete'
%
info
),
...
@@ -622,7 +622,6 @@ class ModelAdmin(BaseModelAdmin):
...
@@ -622,7 +622,6 @@ class ModelAdmin(BaseModelAdmin):
pattern_name
=
'
%
s:
%
s_
%
s_change'
%
((
self
.
admin_site
.
name
,)
+
info
)
pattern_name
=
'
%
s:
%
s_
%
s_change'
%
((
self
.
admin_site
.
name
,)
+
info
)
))),
))),
]
]
return
urlpatterns
@property
@property
def
urls
(
self
):
def
urls
(
self
):
...
...
django/contrib/flatpages/views.py
Dosyayı görüntüle @
8b3f1c35
...
@@ -66,5 +66,4 @@ def render_flatpage(request, f):
...
@@ -66,5 +66,4 @@ def render_flatpage(request, f):
f
.
title
=
mark_safe
(
f
.
title
)
f
.
title
=
mark_safe
(
f
.
title
)
f
.
content
=
mark_safe
(
f
.
content
)
f
.
content
=
mark_safe
(
f
.
content
)
response
=
HttpResponse
(
template
.
render
({
'flatpage'
:
f
},
request
))
return
HttpResponse
(
template
.
render
({
'flatpage'
:
f
},
request
))
return
response
django/contrib/gis/gdal/prototypes/errcheck.py
Dosyayı görüntüle @
8b3f1c35
...
@@ -69,8 +69,7 @@ def check_string(result, func, cargs, offset=-1, str_result=False):
...
@@ -69,8 +69,7 @@ def check_string(result, func, cargs, offset=-1, str_result=False):
# ### Envelope checking ###
# ### Envelope checking ###
def
check_envelope
(
result
,
func
,
cargs
,
offset
=-
1
):
def
check_envelope
(
result
,
func
,
cargs
,
offset
=-
1
):
"Check a function that returns an OGR Envelope by reference."
"Check a function that returns an OGR Envelope by reference."
env
=
ptr_byref
(
cargs
,
offset
)
return
ptr_byref
(
cargs
,
offset
)
return
env
# ### Geometry error-checking routines ###
# ### Geometry error-checking routines ###
...
...
django/core/cache/backends/base.py
Dosyayı görüntüle @
8b3f1c35
...
@@ -97,8 +97,7 @@ class BaseCache:
...
@@ -97,8 +97,7 @@ class BaseCache:
if
version
is
None
:
if
version
is
None
:
version
=
self
.
version
version
=
self
.
version
new_key
=
self
.
key_func
(
key
,
self
.
key_prefix
,
version
)
return
self
.
key_func
(
key
,
self
.
key_prefix
,
version
)
return
new_key
def
add
(
self
,
key
,
value
,
timeout
=
DEFAULT_TIMEOUT
,
version
=
None
):
def
add
(
self
,
key
,
value
,
timeout
=
DEFAULT_TIMEOUT
,
version
=
None
):
"""
"""
...
...
django/core/management/commands/loaddata.py
Dosyayı görüntüle @
8b3f1c35
...
@@ -300,8 +300,7 @@ class Command(BaseCommand):
...
@@ -300,8 +300,7 @@ class Command(BaseCommand):
dirs
.
append
(
app_dir
)
dirs
.
append
(
app_dir
)
dirs
.
extend
(
fixture_dirs
)
dirs
.
extend
(
fixture_dirs
)
dirs
.
append
(
''
)
dirs
.
append
(
''
)
dirs
=
[
os
.
path
.
abspath
(
os
.
path
.
realpath
(
d
))
for
d
in
dirs
]
return
[
os
.
path
.
abspath
(
os
.
path
.
realpath
(
d
))
for
d
in
dirs
]
return
dirs
def
parse_name
(
self
,
fixture_name
):
def
parse_name
(
self
,
fixture_name
):
"""
"""
...
...
django/core/management/sql.py
Dosyayı görüntüle @
8b3f1c35
...
@@ -14,8 +14,7 @@ def sql_flush(style, connection, only_django=False, reset_sequences=True, allow_
...
@@ -14,8 +14,7 @@ def sql_flush(style, connection, only_django=False, reset_sequences=True, allow_
else
:
else
:
tables
=
connection
.
introspection
.
table_names
(
include_views
=
False
)
tables
=
connection
.
introspection
.
table_names
(
include_views
=
False
)
seqs
=
connection
.
introspection
.
sequence_list
()
if
reset_sequences
else
()
seqs
=
connection
.
introspection
.
sequence_list
()
if
reset_sequences
else
()
statements
=
connection
.
ops
.
sql_flush
(
style
,
tables
,
seqs
,
allow_cascade
)
return
connection
.
ops
.
sql_flush
(
style
,
tables
,
seqs
,
allow_cascade
)
return
statements
def
emit_pre_migrate_signal
(
verbosity
,
interactive
,
db
,
**
kwargs
):
def
emit_pre_migrate_signal
(
verbosity
,
interactive
,
db
,
**
kwargs
):
...
...
django/db/backends/sqlite3/operations.py
Dosyayı görüntüle @
8b3f1c35
...
@@ -198,14 +198,13 @@ class DatabaseOperations(BaseDatabaseOperations):
...
@@ -198,14 +198,13 @@ class DatabaseOperations(BaseDatabaseOperations):
# Simulate TRUNCATE CASCADE by recursively collecting the tables
# Simulate TRUNCATE CASCADE by recursively collecting the tables
# referencing the tables to be flushed.
# referencing the tables to be flushed.
tables
=
set
(
chain
.
from_iterable
(
self
.
_references_graph
(
table
)
for
table
in
tables
))
tables
=
set
(
chain
.
from_iterable
(
self
.
_references_graph
(
table
)
for
table
in
tables
))
sql
=
[
'
%
s
%
s
%
s;'
%
(
# Note: No requirement for reset of auto-incremented indices (cf. other
# sql_flush() implementations). Just return SQL at this point
return
[
'
%
s
%
s
%
s;'
%
(
style
.
SQL_KEYWORD
(
'DELETE'
),
style
.
SQL_KEYWORD
(
'DELETE'
),
style
.
SQL_KEYWORD
(
'FROM'
),
style
.
SQL_KEYWORD
(
'FROM'
),
style
.
SQL_FIELD
(
self
.
quote_name
(
table
))
style
.
SQL_FIELD
(
self
.
quote_name
(
table
))
)
for
table
in
tables
]
)
for
table
in
tables
]
# Note: No requirement for reset of auto-incremented indices (cf. other
# sql_flush() implementations). Just return SQL at this point
return
sql
def
adapt_datetimefield_value
(
self
,
value
):
def
adapt_datetimefield_value
(
self
,
value
):
if
value
is
None
:
if
value
is
None
:
...
...
django/forms/formsets.py
Dosyayı görüntüle @
8b3f1c35
...
@@ -134,9 +134,10 @@ class BaseFormSet:
...
@@ -134,9 +134,10 @@ class BaseFormSet:
def
forms
(
self
):
def
forms
(
self
):
"""Instantiate forms at first property access."""
"""Instantiate forms at first property access."""
# DoS protection is included in total_form_count()
# DoS protection is included in total_form_count()
forms
=
[
self
.
_construct_form
(
i
,
**
self
.
get_form_kwargs
(
i
))
return
[
for
i
in
range
(
self
.
total_form_count
())]
self
.
_construct_form
(
i
,
**
self
.
get_form_kwargs
(
i
))
return
forms
for
i
in
range
(
self
.
total_form_count
())
]
def
get_form_kwargs
(
self
,
index
):
def
get_form_kwargs
(
self
,
index
):
"""
"""
...
...
django/http/multipartparser.py
Dosyayı görüntüle @
8b3f1c35
...
@@ -360,8 +360,7 @@ class LazyStream:
...
@@ -360,8 +360,7 @@ class LazyStream:
remaining
-=
len
(
emitting
)
remaining
-=
len
(
emitting
)
yield
emitting
yield
emitting
out
=
b
''
.
join
(
parts
())
return
b
''
.
join
(
parts
())
return
out
def
__next__
(
self
):
def
__next__
(
self
):
"""
"""
...
...
django/middleware/csrf.py
Dosyayı görüntüle @
8b3f1c35
...
@@ -64,8 +64,7 @@ def _unsalt_cipher_token(token):
...
@@ -64,8 +64,7 @@ def _unsalt_cipher_token(token):
token
=
token
[
CSRF_SECRET_LENGTH
:]
token
=
token
[
CSRF_SECRET_LENGTH
:]
chars
=
CSRF_ALLOWED_CHARS
chars
=
CSRF_ALLOWED_CHARS
pairs
=
zip
((
chars
.
index
(
x
)
for
x
in
token
),
(
chars
.
index
(
x
)
for
x
in
salt
))
pairs
=
zip
((
chars
.
index
(
x
)
for
x
in
token
),
(
chars
.
index
(
x
)
for
x
in
salt
))
secret
=
''
.
join
(
chars
[
x
-
y
]
for
x
,
y
in
pairs
)
# Note negative values are ok
return
''
.
join
(
chars
[
x
-
y
]
for
x
,
y
in
pairs
)
# Note negative values are ok
return
secret
def
_get_new_csrf_token
():
def
_get_new_csrf_token
():
...
...
django/template/response.py
Dosyayı görüntüle @
8b3f1c35
...
@@ -80,8 +80,7 @@ class SimpleTemplateResponse(HttpResponse):
...
@@ -80,8 +80,7 @@ class SimpleTemplateResponse(HttpResponse):
"""
"""
template
=
self
.
resolve_template
(
self
.
template_name
)
template
=
self
.
resolve_template
(
self
.
template_name
)
context
=
self
.
resolve_context
(
self
.
context_data
)
context
=
self
.
resolve_context
(
self
.
context_data
)
content
=
template
.
render
(
context
,
self
.
_request
)
return
template
.
render
(
context
,
self
.
_request
)
return
content
def
add_post_render_callback
(
self
,
callback
):
def
add_post_render_callback
(
self
,
callback
):
"""Add a new post-rendering callback.
"""Add a new post-rendering callback.
...
...
django/test/utils.py
Dosyayı görüntüle @
8b3f1c35
...
@@ -306,8 +306,7 @@ def get_runner(settings, test_runner_class=None):
...
@@ -306,8 +306,7 @@ def get_runner(settings, test_runner_class=None):
else
:
else
:
test_module_name
=
'.'
test_module_name
=
'.'
test_module
=
__import__
(
test_module_name
,
{},
{},
test_path
[
-
1
])
test_module
=
__import__
(
test_module_name
,
{},
{},
test_path
[
-
1
])
test_runner
=
getattr
(
test_module
,
test_path
[
-
1
])
return
getattr
(
test_module
,
test_path
[
-
1
])
return
test_runner
class
TestContextDecorator
:
class
TestContextDecorator
:
...
@@ -757,7 +756,7 @@ def require_jinja2(test_func):
...
@@ -757,7 +756,7 @@ def require_jinja2(test_func):
Django template engine for a test or skip it if Jinja2 isn't available.
Django template engine for a test or skip it if Jinja2 isn't available.
"""
"""
test_func
=
skipIf
(
jinja2
is
None
,
"this test requires jinja2"
)(
test_func
)
test_func
=
skipIf
(
jinja2
is
None
,
"this test requires jinja2"
)(
test_func
)
test_func
=
override_settings
(
TEMPLATES
=
[{
return
override_settings
(
TEMPLATES
=
[{
'BACKEND'
:
'django.template.backends.django.DjangoTemplates'
,
'BACKEND'
:
'django.template.backends.django.DjangoTemplates'
,
'APP_DIRS'
:
True
,
'APP_DIRS'
:
True
,
},
{
},
{
...
@@ -765,7 +764,6 @@ def require_jinja2(test_func):
...
@@ -765,7 +764,6 @@ def require_jinja2(test_func):
'APP_DIRS'
:
True
,
'APP_DIRS'
:
True
,
'OPTIONS'
:
{
'keep_trailing_newline'
:
True
},
'OPTIONS'
:
{
'keep_trailing_newline'
:
True
},
}])(
test_func
)
}])(
test_func
)
return
test_func
class
override_script_prefix
(
TestContextDecorator
):
class
override_script_prefix
(
TestContextDecorator
):
...
...
tests/logging_tests/tests.py
Dosyayı görüntüle @
8b3f1c35
...
@@ -251,11 +251,10 @@ class AdminEmailHandlerTest(SimpleTestCase):
...
@@ -251,11 +251,10 @@ class AdminEmailHandlerTest(SimpleTestCase):
def
get_admin_email_handler
(
self
,
logger
):
def
get_admin_email_handler
(
self
,
logger
):
# AdminEmailHandler does not get filtered out
# AdminEmailHandler does not get filtered out
# even with DEBUG=True.
# even with DEBUG=True.
admin_email_handler
=
[
return
[
h
for
h
in
logger
.
handlers
h
for
h
in
logger
.
handlers
if
h
.
__class__
.
__name__
==
"AdminEmailHandler"
if
h
.
__class__
.
__name__
==
"AdminEmailHandler"
][
0
]
][
0
]
return
admin_email_handler
def
test_fail_silently
(
self
):
def
test_fail_silently
(
self
):
admin_email_handler
=
self
.
get_admin_email_handler
(
self
.
logger
)
admin_email_handler
=
self
.
get_admin_email_handler
(
self
.
logger
)
...
...
tests/test_client_regress/views.py
Dosyayı görüntüle @
8b3f1c35
...
@@ -117,8 +117,7 @@ def return_text_file(request):
...
@@ -117,8 +117,7 @@ def return_text_file(request):
else
:
else
:
charset
=
settings
.
DEFAULT_CHARSET
charset
=
settings
.
DEFAULT_CHARSET
response
=
HttpResponse
(
request
.
body
,
status
=
200
,
content_type
=
'text/plain; charset=
%
s'
%
charset
)
return
HttpResponse
(
request
.
body
,
status
=
200
,
content_type
=
'text/plain; charset=
%
s'
%
charset
)
return
response
def
check_headers
(
request
):
def
check_headers
(
request
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment