clean up webapps crap
This commit is contained in:
Родитель
ccc999cd8e
Коммит
176c18a692
|
@ -1458,8 +1458,6 @@ class AddonType(amo.models.ModelBase):
|
|||
type = amo.ADDON_SLUGS[self.id]
|
||||
except KeyError:
|
||||
return None
|
||||
if type == 'apps':
|
||||
return reverse('apps.list')
|
||||
return reverse('browse.%s' % type)
|
||||
|
||||
|
||||
|
@ -1536,8 +1534,7 @@ class Category(amo.models.ModelBase):
|
|||
type = amo.ADDON_SLUGS[self.type]
|
||||
except KeyError:
|
||||
type = amo.ADDON_SLUGS[amo.ADDON_EXTENSION]
|
||||
view = 'apps.list' if type == 'apps' else 'browse.%s' % type
|
||||
return reverse(view, args=[self.slug])
|
||||
return reverse('browse.%s' % type, args=[self.slug])
|
||||
|
||||
@staticmethod
|
||||
def transformer(addons):
|
||||
|
|
|
@ -20,5 +20,5 @@
|
|||
data-manifest-url="{% if (addon.is_premium() and addon.has_purchased(amo_user)) or (not addon.is_premium()) -%}
|
||||
{{ addon.manifest_url }}
|
||||
{%- endif %}"
|
||||
data-record-url="{{ url('detail.record', addon.app_slug) }}"
|
||||
data-record-url="{{ addon.get_detail_url('record') }}"
|
||||
{% endif %}
|
||||
|
|
|
@ -45,7 +45,6 @@
|
|||
{% set base_crumb = {
|
||||
'extensions': (url('browse.extensions'), _('Extensions')),
|
||||
'themes': (url('browse.themes'), _('Themes')),
|
||||
'apps': (url('apps.list'), _('Apps'))
|
||||
}.get(section, 'extensions') %}
|
||||
|
||||
{% if section == 'extensions' %}
|
||||
|
|
|
@ -2,12 +2,11 @@
|
|||
import json
|
||||
import urlparse
|
||||
|
||||
from django.conf import settings
|
||||
from django.http import QueryDict
|
||||
from django.test import client
|
||||
|
||||
from jingo.helpers import datetime as datetime_filter
|
||||
from mock import Mock, patch
|
||||
from mock import Mock
|
||||
from nose import SkipTest
|
||||
from nose.tools import eq_
|
||||
from pyquery import PyQuery as pq
|
||||
|
@ -26,7 +25,6 @@ from search.views import DEFAULT_NUM_PERSONAS
|
|||
from tags.models import Tag
|
||||
from versions.compare import num as vnum, version_int as vint, MAXVERSION
|
||||
from versions.models import ApplicationsVersions
|
||||
from mkt.webapps.tests.test_views import PaidAppMixin
|
||||
|
||||
|
||||
def test_parse_bad_type():
|
||||
|
|
|
@ -375,6 +375,7 @@ INSTALLED_APPS = (
|
|||
'translations',
|
||||
'users',
|
||||
'versions',
|
||||
'mkt.webapps',
|
||||
'zadmin',
|
||||
'cake',
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@ from urllib import urlencode
|
|||
import urlparse
|
||||
|
||||
from django.conf import settings
|
||||
from django.core.urlresolvers import NoReverseMatch
|
||||
from django.db import models
|
||||
from django.dispatch import receiver
|
||||
|
||||
|
@ -88,7 +89,18 @@ class Webapp(Addon):
|
|||
self.update(slug='app-%s' % self.id)
|
||||
|
||||
def get_url_path(self, more=False):
|
||||
return reverse('detail', args=[self.app_slug])
|
||||
# We won't have to do this when Marketplace absorbs all apps views,
|
||||
# but for now pretend you didn't see this.
|
||||
try:
|
||||
return reverse('detail', args=[self.app_slug])
|
||||
except NoReverseMatch:
|
||||
# Fall back to old details page until the views get ported.
|
||||
return super(Webapp, self).get_url_path(more=more)
|
||||
|
||||
def get_detail_url(self, action=None):
|
||||
# Reverse URLs for 'detail', 'details.record', etc.
|
||||
return reverse(('detail.%s' % action) if action else 'detail',
|
||||
args=[self.app_slug])
|
||||
|
||||
def get_dev_url(self, action='edit', args=None, prefix_only=False):
|
||||
# Either link to the "new" Marketplace Developer Hub or the old one.
|
||||
|
|
Загрузка…
Ссылка в новой задаче