Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4.3.3 bugs #7

Merged
merged 25 commits into from Oct 14, 2011
Merged

4.3.3 bugs #7

merged 25 commits into from Oct 14, 2011

Conversation

atarkowska
Copy link
Member

Please, pull those bug fixes 4.3.3 to develop.

@atarkowska
Copy link
Member Author

This is the standard way of sending back files in django:

from django.core.files.temp import NamedTemporaryFile
def send_file(request):
    newfile = NamedTemporaryFile()
    ...
    wrapper = FileWrapper(newfile)
    response = HttpResponse(wrapper, content_type=mime_type)
    response['Content-Disposition'] = 'attachment; filename=%s' % newfile.name
    response['Content-Length'] = newfile.tell()
    return response

NamedTemporaryFile should be deleted once the newfile object is evicted. When you step out of the send_file function, there should be no more reference to the newfile object, but it's not guaranteed that the object will be garbage-collected and its del method called. From the other hand I am not aware about any built-in mechanism to automatically delete TemporaryFile instances within HttpRespons.

I got ride of some of NamedTemporaryFile becuse we are yielding OriginalFile and this can write directly to HttpResponse, but there are still two cases where: multiple files are zipped and mrc map is asking for real file.

@joshmoore
Copy link
Member

While testing:

  • Import image (spin.dcm)
  • View in latest web
  • Click on web scripts
  • Choose Batch_Image_Export.py
  • Wait until finished
  • Click on "Info" for zip file
  • QueryException (see below)
Request URL: http://localhost:8000/webclient/get_original_file/311/
Traceback:
File "/Users/moore/GlencoeSoftware.git/git/omero.git/dist/lib/python/django/core/handlers/base.py" in get_response
  92.                 response = callback(request, *callback_args, **callback_kwargs)
File "/Users/moore/GlencoeSoftware.git/git/omero.git/dist/lib/python/omeroweb/webclient/views.py" in wrapped
  174.         return f(request, *args, **kwargs)
File "/Users/moore/GlencoeSoftware.git/git/omero.git/dist/lib/python/omeroweb/webclient/views.py" in get_original_file
  1820.     orig_file = conn.getObject("OriginalFile", fileId)
File "/Users/moore/GlencoeSoftware.git/git/omero.git/dist/lib/python/omero/gateway/__init__.py" in getObject
  2294.         result = self.getQueryService().findByQuery(query, params)
File "/Users/moore/GlencoeSoftware.git/git/omero.git/dist/lib/python/omero/gateway/__init__.py" in __call__
  2959.             return self.handle_exception(e, *args, **kwargs)
File "/Users/moore/GlencoeSoftware.git/git/omero.git/dist/lib/python/omeroweb/webclient/webclient_gateway.py" in handle_exception
  1651.                     e, *args, **kwargs)
File "/Users/moore/GlencoeSoftware.git/git/omero.git/dist/lib/python/omero/gateway/__init__.py" in __call__
  2956.             return self.f(*args, **kwargs)
File "/Users/moore/GlencoeSoftware.git/git/omero.git/dist/lib/python/omero_api_IQuery_ice.py" in findByQuery
  132.             return _M_omero.api.IQuery._op_findByQuery.invoke(self, ((query, params), _ctx))

Exception Type: QueryException at /webclient/get_original_file/311/
Exception Value: 

This issue was temporarily http://trac.openmicroscopy.org.uk/ome/ticket/6950 which has been closed in favor of this location.

@joshmoore
Copy link
Member

Running with these fixes, "Info" works fine now. Tried to delete the zip and got


TemplateSyntaxError at /webclient/metadata_details/image/101/

Environment:

Request Method: GET
Request URL: http://localhost:8000/webclient/metadata_details/image/101/
Django Version: 1.1.1
Python Version: 2.6.1
Installed Applications:
['django.contrib.admin',
 'django.contrib.markup',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'omeroweb.feedback',
 'omeroweb.webadmin',
 'omeroweb.webclient',
 'omeroweb.webgateway',
 'omeroweb.webtest',
 'omeroweb.webmobile',
 'omeroweb.webpublic',
 'omeroweb.webredirect']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.doc.XViewMiddleware')


Template error:
In template /Users/moore/GlencoeSoftware.git/git/omero.git/dist/lib/python/omeroweb/webclient/templates/webclient/annotations/metadata_general.html, error at line 689
   Caught an exception while rendering: 
   679 :                     {% if manager.image.isEditable %}<a href="{% url manage_action_containers "newfile" "image" manager.image.id %}?url={{url}}"><img src="{% url webstatic "images/plus_11.png" %}" alt="e" title="Attache new file or use an existing one."/></a>{% else %}


   680 :                     {% if manager.screen.isEditable %}<a href="{% url manage_action_containers "newfile" "screen" manager.screen.id %}?url={{url}}"><img src="{% url webstatic "images/plus_11.png" %}" alt="e" title="Attache new file or use an existing one."/></a>{% else %}


   681 :                     {% if manager.plate.isEditable %}<a href="{% url manage_action_containers "newfile" "plate" manager.plate.id %}?url={{url}}"><img src="{% url webstatic "images/plus_11.png" %}" alt="e" title="Attache new file or use an existing one."/></a>{% else %}


   682 :                     {% if manager.acquisition.isEditable %}<a href="{% url manage_action_containers "newfile" "acquisition" manager.acquisition.id %}?url={{url}}"><img src="{% url webstatic "images/plus_11.png" %}" alt="e" title="Attache new file or use an existing one."/></a>{% else %}


   683 :                     {% if manager.well.isEditable %}<a href="{% url manage_action_containers "newfile" "well" manager.well.id %}{% if index %}?index={{ index }}&{% else %}?{% endif %}url={{url}}"><img src="{% url webstatic "images/plus_11.png" %}" alt="e" title="Attache new file or use an existing one."/></a>


   684 :                     {% endif %}{% endif %}{% endif %}{% endif %}{% endif %}{% endif %}{% endif %}


   685 :                 </td>


   686 :                 <td>


   687 :                     {% if manager.fileannSize %}


   688 :                     <div class="lnfiles">


   689 :                          {% for fileann in manager.file_annotations %} 


   690 :                         {% if fileann.getFileName %}


   691 :                         <div style="padding:4px 0px" class="file_ann_wrapper">


   692 :                             <a class='tooltip' href="#" onClick="document.location.href='{% url download_annotation "download" fileann.id %}';" 


   693 :                                 title="Linked by {{ fileann.link.getDetails.getOwner.getNameWithInitial }} {% trans "at" %} {{ fileann.creationEventDate|date:"Y-m-d H:i:s" }}. {% trans "Owner:" %} {{ fileann.getDetails.getOwner.getNameWithInitial }}">


   694 :                                 {{ fileann.getFileName|shortening:40 }}


   695 :                             </a>


   696 :                             <span style='display:none'>


   697 :                                 <b>Owner:</b> {{ fileann.getOwner.getFullName }}<br />


   698 :                                 <b>Linked by:</b> {{ fileann.link.getDetails.getOwner.getFullName }}<br />


   699 :                                 <b>On:</b> {{ fileann.link.creationEventDate|date:"Y-m-d H:i:s" }}<br />


Traceback:
File "/Users/moore/GlencoeSoftware.git/git/omero.git/dist/lib/python/django/core/handlers/base.py" in get_response
  92.                 response = callback(request, *callback_args, **callback_kwargs)
File "/Users/moore/GlencoeSoftware.git/git/omero.git/dist/lib/python/omeroweb/webclient/views.py" in wrapped
  174.         return f(request, *args, **kwargs)
File "/Users/moore/GlencoeSoftware.git/git/omero.git/dist/lib/python/omeroweb/webclient/views.py" in load_metadata_details
  988.     return HttpResponse(t.render(c))
File "/Users/moore/GlencoeSoftware.git/git/omero.git/dist/lib/python/django/template/__init__.py" in render
  178.         return self.nodelist.render(context)
File "/Users/moore/GlencoeSoftware.git/git/omero.git/dist/lib/python/django/template/__init__.py" in render
  779.                 bits.append(self.render_node(node, context))
File "/Users/moore/GlencoeSoftware.git/git/omero.git/dist/lib/python/django/template/debug.py" in render_node
  71.             result = node.render(context)
File "/Users/moore/GlencoeSoftware.git/git/omero.git/dist/lib/python/django/template/loader_tags.py" in render
  97.         return compiled_parent.render(context)
File "/Users/moore/GlencoeSoftware.git/git/omero.git/dist/lib/python/django/template/__init__.py" in render
  178.         return self.nodelist.render(context)
File "/Users/moore/GlencoeSoftware.git/git/omero.git/dist/lib/python/django/template/__init__.py" in render
  779.                 bits.append(self.render_node(node, context))
File "/Users/moore/GlencoeSoftware.git/git/omero.git/dist/lib/python/django/template/debug.py" in render_node
  71.             result = node.render(context)
File "/Users/moore/GlencoeSoftware.git/git/omero.git/dist/lib/python/django/template/loader_tags.py" in render
  24.         result = self.nodelist.render(context)
File "/Users/moore/GlencoeSoftware.git/git/omero.git/dist/lib/python/django/template/__init__.py" in render
  779.                 bits.append(self.render_node(node, context))
File "/Users/moore/GlencoeSoftware.git/git/omero.git/dist/lib/python/django/template/debug.py" in render_node
  71.             result = node.render(context)
File "/Users/moore/GlencoeSoftware.git/git/omero.git/dist/lib/python/django/template/defaulttags.py" in render
  243.                     return self.nodelist_true.render(context)
File "/Users/moore/GlencoeSoftware.git/git/omero.git/dist/lib/python/django/template/__init__.py" in render
  779.                 bits.append(self.render_node(node, context))
File "/Users/moore/GlencoeSoftware.git/git/omero.git/dist/lib/python/django/template/debug.py" in render_node
  71.             result = node.render(context)
File "/Users/moore/GlencoeSoftware.git/git/omero.git/dist/lib/python/django/template/defaulttags.py" in render
  243.                     return self.nodelist_true.render(context)
File "/Users/moore/GlencoeSoftware.git/git/omero.git/dist/lib/python/django/template/__init__.py" in render
  779.                 bits.append(self.render_node(node, context))
File "/Users/moore/GlencoeSoftware.git/git/omero.git/dist/lib/python/django/template/debug.py" in render_node
  81.             raise wrapped

Exception Type: TemplateSyntaxError at /webclient/metadata_details/image/101/
Exception Value: Caught an exception while rendering: 

@joshmoore
Copy link
Member

screenshot of TemplateSyntaxError

@joshmoore
Copy link
Member

Reproduced using this branch, running under nginx with omero.web.debug=true. Happens under ff 6.0.2 but not under chrome 14.0.835. @will-moore and @chris-allan, any ideas?

@chris-allan
Copy link
Member

Testing update:

  • Pass for tickets #6912, #6913, #6922, #6863, #6966 (Firefox 7.0.1; Mac OS X)
  • Pass for tickets #6921, #6793 on Linux (Firefox 7.0.1; Mac OS X)
  • Failure for tickets Remove command #4470 on Project, Dataset, Image, Screen, Plate and PlateAcquisition

@chris-allan
Copy link
Member

After refreshing .../appmedia/omeroweb/javascript/jquery.editinplace.js we have a pass for #4470 on all model objects for which OMERO.web allows name editing in the right hand panel.

@chris-allan
Copy link
Member

Pass for ticket #6993 (Firefox 7.0.1; Mac OS X)

@chris-allan
Copy link
Member

Pass for tickets #6995 (MSIE 8 and MSIE 9) and #4470 (Firefox 7.0.1; Mac OS X and MSIE 8)

chris-allan added a commit that referenced this pull request Oct 14, 2011
@chris-allan chris-allan merged commit 38ac508 into ome:develop Oct 14, 2011
sbesson pushed a commit to sbesson/openmicroscopy that referenced this pull request May 28, 2012
bpindelski pushed a commit to bpindelski/openmicroscopy that referenced this pull request Oct 18, 2012
FS-lite work from FS Tix review
snoopycrimecop pushed a commit to snoopycrimecop/openmicroscopy that referenced this pull request Mar 13, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants