Skip to content

Commit

Permalink
PreDjango 4.2 fixes (DefectDojo#9882)
Browse files Browse the repository at this point in the history
  • Loading branch information
kiblik authored and hblankenship committed Apr 26, 2024
1 parent 6bf285c commit 785ecbc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
6 changes: 3 additions & 3 deletions dojo/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1656,7 +1656,7 @@ def clean(self):
action_string = 'Postgres does not accept NULL character. Attempting to replace with %00...'
for remove_str in null_char_list:
self.path = self.path.replace(remove_str, '%00')
errors.append(ValidationError(f'Path "{old_value}" has invalid format - It contains the NULL character. The following action was taken: {action_string}'))
logging.error(f'Path "{old_value}" has invalid format - It contains the NULL character. The following action was taken: {action_string}')
if self.path == '':
self.path = None

Expand All @@ -1669,7 +1669,7 @@ def clean(self):
action_string = 'Postgres does not accept NULL character. Attempting to replace with %00...'
for remove_str in null_char_list:
self.query = self.query.replace(remove_str, '%00')
errors.append(ValidationError(f'Query "{old_value}" has invalid format - It contains the NULL character. The following action was taken: {action_string}'))
logging.error(f'Query "{old_value}" has invalid format - It contains the NULL character. The following action was taken: {action_string}')
if self.query == '':
self.query = None

Expand All @@ -1682,7 +1682,7 @@ def clean(self):
action_string = 'Postgres does not accept NULL character. Attempting to replace with %00...'
for remove_str in null_char_list:
self.fragment = self.fragment.replace(remove_str, '%00')
errors.append(ValidationError(f'Fragment "{old_value}" has invalid format - It contains the NULL character. The following action was taken: {action_string}'))
logging.error(f'Fragment "{old_value}" has invalid format - It contains the NULL character. The following action was taken: {action_string}')
if self.fragment == '':
self.fragment = None

Expand Down
3 changes: 0 additions & 3 deletions dojo/settings/settings.dist.py
Original file line number Diff line number Diff line change
Expand Up @@ -493,10 +493,7 @@ def generate_url(scheme, double_slashes, user, password, host, port, path, param
'django.contrib.auth.hashers.PBKDF2SHA1PasswordHasher',
'django.contrib.auth.hashers.BCryptSHA256PasswordHasher',
'django.contrib.auth.hashers.BCryptPasswordHasher',
'django.contrib.auth.hashers.SHA1PasswordHasher',
'django.contrib.auth.hashers.MD5PasswordHasher',
'django.contrib.auth.hashers.UnsaltedSHA1PasswordHasher',
'django.contrib.auth.hashers.UnsaltedMD5PasswordHasher',
]

SOCIAL_AUTH_PIPELINE = (
Expand Down

0 comments on commit 785ecbc

Please sign in to comment.