Disables showing UUID errors in validation until it works (bug 636494)

This commit is contained in:
Kumar McMillan 2011-07-05 18:16:20 -05:00
Родитель a874b6af0a
Коммит 6b8d6cae59
3 изменённых файлов: 16 добавлений и 8 удалений

Просмотреть файл

@ -51,6 +51,7 @@ class TestUploadValidation(BaseUploadTest):
class TestUploadErrors(BaseUploadTest):
fixtures = ('base/apps', 'base/addon_3615')
@mock.patch.object(settings, 'SHOW_UUID_ERRORS_IN_VALIDATION', True)
def test_dupe_uuid(self):
addon = Addon.objects.get(pk=3615)
d = parse_addon(self.get_upload('extension.xpi').path)

Просмотреть файл

@ -723,14 +723,18 @@ def json_upload_detail(upload):
plat_exclude = set(s) - set(supported_platforms)
plat_exclude = [str(p) for p in plat_exclude]
except django_forms.ValidationError, exc:
m = []
for msg in exc.messages:
# Simulate a validation error so the UI displays
# it as such
m.append({'type': 'error', 'message': msg, 'tier': 1})
v = make_validation_result(dict(error='',
validation=dict(messages=m)))
return json_view.error(v)
if settings.SHOW_UUID_ERRORS_IN_VALIDATION:
m = []
for msg in exc.messages:
# Simulate a validation error so the UI displays
# it as such
m.append({'type': 'error',
'message': msg, 'tier': 1})
v = make_validation_result(dict(error='',
validation=dict(messages=m)))
return json_view.error(v)
else:
log.error("XPI parsing error, ignored: %s" % exc)
return make_validation_result(dict(upload=upload.uuid,
validation=validation,

Просмотреть файл

@ -1027,3 +1027,6 @@ KNOWN_PROXIES = []
# Blog URL
DEVELOPER_BLOG_URL = "http://blog.mozilla.com/addons/feed/"
# TODO(Kumar) Remove this (or set to True) when it works. See bug 636494
SHOW_UUID_ERRORS_IN_VALIDATION = False