scipy / SciPyCentral

SciPy Central
http://scipy-central.org
BSD 3-Clause "New" or "Revised" License
16 stars 12 forks source link

BUG: Fix creating revisions to existing submission #146

Closed ksurya closed 10 years ago

ksurya commented 10 years ago

Fix issue: https://github.com/scipy/SciPyCentral/issues/140

ksurya commented 10 years ago

@pv @lomegor could you please take a look into this fix and let me know if you are getting any errors.

lomegor commented 10 years ago

There's one problem: if I upload the same zip file, I still get a Django error page, instead of some error in the page. Also, as soon as the edit submission page loads, it tells me there is an error in the form (that I haven't uploaded a file, which of course I haven't since I just loaded the page).

For the error to happen, you have to download the zip and then try uploading that zip you downloaded.

ksurya commented 10 years ago

You are getting a error in the form when uploading ZIP file or a 500? In case of form error, the below might be the issue

our code assumes zip files to have content-type application/zip. However, when I tested the uploading, the files content type is taken as application/octet-stream.

lomegor commented 10 years ago

I'm getting a 500 error. Can you please try to reproduce what I told you?

ksurya commented 10 years ago

Sure, I will look into it.Strange, didn't observe it before

ksurya commented 10 years ago

I am looking into this PR now. There is some misbehaviour I can see (there might be other errors too)

  1. When I create Revision to a package (only authors of the original submission can do), I am observing server error
  2. As Sebastian stated before, When we "edit" the Submission, its unable to carry attached file

One simple way to fix everything is to revert https://github.com/scipy/SciPyCentral/commit/9cec5bf1fac3cc125342eb5f7138aa84fb6cd265

ksurya commented 10 years ago
  1. When a submission (snippet) is improved by another user, new submission is created instead of revision.
  2. The above comment [2] error is present even in the current deployment. Its just elegant enough to not show error in that situation as user want to submit new zip file upon creating new revision.
ksurya commented 10 years ago

Fixed in https://github.com/scipy/SciPyCentral/pull/168