Skip to content

Commit a708571

Browse files
committed
Added some new patches, including a patch to patch.py to let us report when patching has happened.
- Legacy-Id: 14663
1 parent 06362ec commit a708571

2 files changed

Lines changed: 31 additions & 2 deletions

File tree

ietf/checks.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,13 +366,23 @@ def maybe_patch_library(app_configs, **kwargs):
366366
for patch_file in settings.CHECKS_LIBRARY_PATCHES_TO_APPLY:
367367
patch_path = os.path.join(saved_cwd, patch_file)
368368
patch_set = patch.fromfile(patch_path)
369+
if not hasattr(patch_set, 'already_patched'):
370+
patch_set.already_patched = False
369371
if patch_set:
370-
if not patch_set.apply():
372+
applied = patch_set.apply()
373+
if not applied:
371374
errors.append(checks.Warning(
372375
"Could not apply patch from file '%s'"%patch_file,
373376
hint="Make sure that the patch file contains a unified diff and has valid file paths",
374377
id="datatracker.W0002",
375378
))
379+
elif patch_set.already_patched:
380+
#for p in patch_set:
381+
# sys.stderr.write(" Already patched: %s\n" % p.target)
382+
pass
383+
else:
384+
for p in patch_set:
385+
sys.stderr.write(" Patched %s\n" % p.target)
376386
else:
377387
errors.append(checks.Warning(
378388
"Could not parse patch file '%s'"%patch_file,
Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,30 @@
11
--- django/db/models/fields/__init__.py.old 2017-06-14 08:43:21.665812000 -0700
22
+++ django/db/models/fields/__init__.py 2017-12-17 14:34:03.023976702 -0800
3-
@@ -2344,7 +2344,7 @@
3+
@@ -2340,7 +2340,7 @@
44
if self.has_default() and not callable(self.default):
55
return self.default
66
default = super(BinaryField, self).get_default()
77
- if default == '':
88
+ if isinstance(default, six.text_type) and default == '':
99
return b''
1010
return default
11+
12+
--- django/forms/widgets.py.old 2018-02-21 15:17:40.742742712 -0800
13+
+++ django/forms/widgets.py 2018-02-21 15:19:57.182002508 -0800
14+
@@ -7,6 +7,7 @@
15+
import copy
16+
import datetime
17+
import re
18+
+import six
19+
from itertools import chain
1120

21+
from django.conf import settings
22+
@@ -195,7 +196,7 @@
23+
"""
24+
Return a value as it should appear when rendered in a template.
25+
"""
26+
- if value == '' or value is None:
27+
+ if value is None or isinstance(value, six.string_types) and len(value) == 0:
28+
return None
29+
if self.is_localized:
30+
return formats.localize_input(value)

0 commit comments

Comments
 (0)