Delaying upolad of package causes a django error on submit of an application

Bug #762062 reported by Dave Morley
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Developer registration portal
Fix Released
Medium
Michael Nelson

Bug Description

Bug Description:
If you trigger delay upload from the checkbox and get the the getting paid page leave it empty and click on submit you receive a django error if you are also a reviewer.

Version:
Django 1.1.1
Python 2.6.5 (r265:79063, Apr 16 2010, 14:15:55) [GCC 4.4.3]
preflight 0.1
SCA 11.01.dev3ubuntu1-0~226+201104151231; r
openid 2.2.1

OS:
64bit maverick

Browser:
FF 3.6.16

Problem URL:
http://173.212.255.144/dev/apps/5/?step=done

Steps To Reproduce:
1. Ensure that you have review privileges
2. Create a application and use the upload package later checkbox
3. continue to the end and leave the getting paid details empty click on submit

Expected Result:
I expect the application to complete as expected this erred out

Revision history for this message
Dave Morley (davmor2) wrote :

Environment:

Request Method: GET
Request URL: http://173.212.255.144/dev/apps/5/?step=done
Django Version: 1.1.1
Python Version: 2.6.5
Installed Applications:
['django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.markup',
 'django.contrib.admin',
 'django_openid_auth',
 'django_configglue',
 'softwarecenteragent',
 'devportal',
 'south',
 'preflight']
Installed Middleware:
['django.middleware.cache.UpdateCacheMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.middleware.cache.FetchFromCacheMiddleware',
 'softwarecenteragent.middleware.exception.LogExceptionMiddleware',
 'devportal.middleware.AllowOnlyBetaTesters']

Traceback:
File "/usr/lib/pymodules/python2.6/django/core/handlers/base.py" in get_response
  92. response = callback(request, *callback_args, **callback_kwargs)
File "/usr/lib/pymodules/python2.6/django/views/decorators/cache.py" in _wrapped_view_func
  44. response = view_func(request, *args, **kwargs)
File "/usr/lib/pymodules/python2.6/django/contrib/auth/decorators.py" in __call__
  78. return self.view_func(request, *args, **kwargs)
File "/usr/lib/pymodules/python2.6/django/contrib/auth/decorators.py" in __call__
  78. return self.view_func(request, *args, **kwargs)
File "/usr/lib/python2.6/dist-packages/devportal/views.py" in application_detail
  203. 'calls_to_action': calls_to_action_for(app, request.user)
File "/usr/lib/python2.6/dist-packages/devportal/views.py" in calls_to_action_for
  126. (application.package_upload.url, _("Download package"))],
File "/usr/lib/pymodules/python2.6/django/db/models/fields/files.py" in _get_url
  68. self._require_file()
File "/usr/lib/pymodules/python2.6/django/db/models/fields/files.py" in _require_file
  46. raise ValueError("The '%s' attribute has no file associated with it." % self.field.name)

Exception Type: ValueError at /dev/apps/5/
Exception Value: The 'package_upload' attribute has no file associated with it.

tags: added: bug-1
tags: added: kb-defect sp-1
Changed in developer-portal:
importance: Undecided → Medium
Changed in developer-portal:
assignee: nobody → Michael Nelson (michael.nelson)
status: New → In Progress
Revision history for this message
Michael Nelson (michael.nelson) wrote :

That is frustrating... I did check that when I created the QA steps on bug 758692 (BTW: isn't this just showing that the QA steps on that bug failed, in which case why a new bug?).

Anyway, looking into this now.

description: updated
description: updated
Revision history for this message
Michael Nelson (michael.nelson) wrote :

So the issue was that, when you *also* have reviewer privileges, the view helper method which generates the extra links for reviewers was trying to generate the package upload url for draft applications (which may not have a package_upload), even though it wasn't used in the output for draft apps (fixed in the attached branch).

Note: the bug description originally included the reproduction step:

1. Ensure that upload package later is enable

Just to clarify, the ability to upload a package later is *always* on - there is no setting for this. The 'check_for_valid_debian_info' config setting is orthogonal in the sense that it only affects things once a package is uploaded (ie. whether we fail validation if they upload a package without a valid debian control file etc.)

Revision history for this message
Dave Morley (davmor2) wrote :

Michael the new bug is two fold, one the option showed up correctly, the only issue was saving the app at the end. The second reason was to help the project move on :)

Changed in developer-portal:
status: In Progress → Fix Committed
Changed in developer-portal:
status: Fix Committed → Fix Released
Changed in developer-portal:
milestone: none → 11.05
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.