fix TypeError for incompatible app categories on edit page (bug 708263)
This commit is contained in:
Родитель
3e5d0aae7d
Коммит
29a9c2a07d
|
@ -16,6 +16,7 @@ from access import acl
|
|||
import amo
|
||||
import captcha.fields
|
||||
from amo.fields import ColorField
|
||||
from amo.helpers import loc
|
||||
from amo.urlresolvers import reverse
|
||||
from amo.utils import slug_validator, slugify, sorted_groupby, remove_icons
|
||||
from addons.models import (Addon, AddonCategory, AddonUser, BlacklistedSlug,
|
||||
|
@ -231,7 +232,7 @@ class CategoryForm(forms.Form):
|
|||
max_cat = amo.MAX_CATEGORIES
|
||||
if getattr(self, 'disabled', False) and total:
|
||||
if categories[0].type == amo.ADDON_WEBAPP:
|
||||
raise forms.ValidationError(_('Categories cannot be changed '
|
||||
raise forms.ValidationError(loc('Categories cannot be changed '
|
||||
'while your app is featured for this application.'))
|
||||
else:
|
||||
raise forms.ValidationError(_('Categories cannot be changed '
|
||||
|
|
|
@ -107,7 +107,7 @@
|
|||
{% if form.disabled %}
|
||||
<p class="addon-app-cats addon-app-cats-inline">
|
||||
<b>{{ form.app.pretty }}:</b>
|
||||
{% set cats = dict(addon.app_categories).get(form.app) %}
|
||||
{% set cats = dict(addon.app_categories).get(form.app, []) %}
|
||||
{{ cats|join(' · ')|safe }}
|
||||
</p>
|
||||
<p>
|
||||
|
|
Загрузка…
Ссылка в новой задаче