Status

defect
P3
normal
RESOLVED FIXED
9 years ago
3 years ago

People

(Reporter: andy+bugzilla, Assigned: jbalogh)

Tracking

unspecified
5.12.5
x86
macOS
Dependency tree / graph

Details

Reporter

Description

9 years ago
You should not be able to upload any files if the maximum number of files/platform has been reached. For a search engine addon this is one. For other addons this is 4 (not including unsupported platforms).

This is manifest if you try to upload a file for a platform that already exists. For example on at: /en-US/developers/addon/7431/versions/84102

If you upload a file for a platform that already exists, it will complete the upload. Then you click save it will validate and give an error on the platform. The data is not enough to represent in the form and you get a traceback (below).

But we should have been able to stop the upload before then.

Traceback (most recent call last):

  File "/Users/andy/sandboxes/zamboni/vendor/src/django/django/core/servers/basehttp.py", line 280, in run
    self.result = application(self.environ, self.start_response)

  File "/Users/andy/sandboxes/zamboni/vendor/src/django/django/core/servers/basehttp.py", line 674, in __call__
    return self.application(environ, start_response)

  File "/Users/andy/sandboxes/zamboni/vendor/src/django/django/core/handlers/wsgi.py", line 241, in __call__
    response = self.get_response(request)

  File "/Users/andy/sandboxes/zamboni/vendor/src/django/django/core/handlers/base.py", line 141, in get_response
    return self.handle_uncaught_exception(request, resolver, sys.exc_info())

  File "/Users/andy/sandboxes/zamboni/vendor/src/django/django/core/handlers/base.py", line 100, in get_response
    response = callback(request, *callback_args, **callback_kwargs)

  File "/Users/andy/sandboxes/zamboni/apps/amo/decorators.py", line 77, in wrapper
    return f(*args, **kw)

  File "/Users/andy/sandboxes/zamboni/apps/amo/decorators.py", line 69, in wrapper
    return f(*args, **kw)

  File "/Users/andy/sandboxes/zamboni/apps/amo/decorators.py", line 24, in wrapper
    return func(request, *args, **kw)

  File "/Users/andy/sandboxes/zamboni/apps/devhub/views.py", line 57, in wrapper
    return fun()

  File "/Users/andy/sandboxes/zamboni/apps/devhub/views.py", line 53, in <lambda>
    fun = lambda: f(request, addon_id=addon_id, addon=addon, *args, **kw)

  File "/Users/andy/sandboxes/zamboni/apps/devhub/views.py", line 520, in version_edit
    return jingo.render(request, 'devhub/versions/edit.html', data)

  File "/Users/andy/sandboxes/zamboni/vendor/src/jingo/jingo/__init__.py", line 78, in render
    rendered = render_to_string(request, template, context)

  File "/Users/andy/sandboxes/zamboni/vendor/src/jingo/jingo/__init__.py", line 96, in render_to_string
    return template.render(**get_context())

  File "/Users/andy/.virtualenvs/zamboni/lib/python2.6/site-packages/jinja2/environment.py", line 705, in render
    return self.environment.handle_exception(exc_info, True)

  File "/Users/andy/sandboxes/zamboni/apps/devhub/templates/devhub/versions/edit.html", line 5, in top-level template code
    {% set title = _('Manage Version {0}')|f(version.version) %}

  File "/Users/andy/sandboxes/zamboni/apps/devhub/templates/devhub/base.html", line 1, in top-level template code
    {% extends "base.html" %}

  File "/Users/andy/sandboxes/zamboni/templates/base.html", line 88, in top-level template code
    {% block main_content %}

  File "/Users/andy/sandboxes/zamboni/templates/base.html", line 97, in block "main_content"
    {% block content %}{% endblock %}

  File "/Users/andy/sandboxes/zamboni/apps/devhub/templates/devhub/versions/edit.html", line 31, in block "content"
    {% include "devhub/includes/version_file.html" %}

  File "/Users/andy/sandboxes/zamboni/apps/devhub/templates/devhub/includes/version_file.html", line 4, in top-level template code
    <a href="{{ file.get_url_path(amo.FIREFOX, 'devhub') }}">

  File "/Users/andy/sandboxes/zamboni/apps/files/models.py", line 48, in get_url_path
    url = os.path.join(reverse('downloads.file', args=[self.id]),

  File "/Users/andy/sandboxes/zamboni/apps/amo/urlresolvers.py", line 58, in reverse
    url = django_reverse(viewname, urlconf, args, kwargs, prefix, current_app)

  File "/Users/andy/sandboxes/zamboni/vendor/src/django/django/core/urlresolvers.py", line 350, in reverse
    *args, **kwargs)))

  File "/Users/andy/sandboxes/zamboni/vendor/src/django/django/core/urlresolvers.py", line 296, in reverse
    "arguments '%s' not found." % (lookup_view_s, args, kwargs))

NoReverseMatch: Reverse for 'downloads.file' with arguments '(None,)' and keyword arguments '{}' not found.
Assignee

Comment 1

9 years ago
This is one of a crapton of bugs I sprinkled throughout the uploader. myamobugs says tomorrow is the time for writing tests for uploads, so this might get fixed soon.  And we'll be breaking 1000 in Hudson.  Nice bug report.
Depends on: 612371
Reporter

Comment 2

9 years ago
Actually I believe that traceback is for something else.

Comment 3

9 years ago
If the existing add-on file has platform set to "ALL", then we should not allow any more file uploads for that version.
Assignee

Comment 4

9 years ago
I'm ignoring the traceback.  This is fixed for everything but search engines (which shouldn't allow platform choices).
Assignee: nobody → jbalogh
Target Milestone: 5.12.4 → 5.12.5
Priority: -- → P3
Assignee

Comment 5

9 years ago
andym started hiding platforms in https://github.com/jbalogh/zamboni/commit/7fc64d92eba which is good enough for me.  If people want to tamperdata and make their addon inaccessible to some people, I don't feel inclined to stop them.

Thanks andy!
Status: NEW → RESOLVED
Last Resolved: 9 years ago
Resolution: --- → FIXED
Product: addons.mozilla.org → addons.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.