Skip to content

Commit

Permalink
Removing unused index=REQUEST['index'], cleanup others
Browse files Browse the repository at this point in the history
  • Loading branch information
Will Moore committed Apr 13, 2012
1 parent cf17983 commit c35bac9
Showing 1 changed file with 12 additions and 29 deletions.
41 changes: 12 additions & 29 deletions components/tools/OmeroWeb/omeroweb/webclient/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -532,11 +532,8 @@ def load_data_by_tag(request, o_type=None, o_id=None, conn=None, **kwargs):
# check view
view = request.REQUEST.get("view")

# get index of the plate
try:
index = int(request.REQUEST['index'])
except:
index = 0
# the index of a field within a well
index = int(request.REQUEST.get('index', 0))

# prepare forms
filter_user_id = request.session.get('nav')['experimenter']
Expand Down Expand Up @@ -678,11 +675,8 @@ def load_metadata_details(request, c_type, c_id, conn=None, share_id=None, **kwa
The data and annotations are loaded by the manager. Display of appropriate data is handled by the template.
"""

try:
# the index of a field within a well
index = int(request.REQUEST['index'])
except:
index = 0
# the index of a field within a well
index = int(request.REQUEST.get('index', 0))

# we only expect a single object, but forms can take multiple objects
images = c_type == "image" and list(conn.getObjects("Image", [c_id])) or list()
Expand Down Expand Up @@ -745,11 +739,8 @@ def load_metadata_preview(request, imageId, conn=None, share_id=None, **kwargs):
Currently this doesn't do much except launch the view-port plugin using the image Id (and share Id if necessary)
"""

try:
# the index of a field within a well
index = int(request.REQUEST['index'])
except:
index = 0
# the index of a field within a well
index = int(request.REQUEST.get('index', 0))

try:
template = "webclient/annotations/metadata_preview.html"
Expand All @@ -771,10 +762,8 @@ def load_metadata_hierarchy(request, c_type, c_id, conn=None, **kwargs):
Used by an AJAX call from the metadata_general panel.
"""

try:
index = int(request.REQUEST['index'])
except:
index = 0
# the index of a field within a well
index = int(request.REQUEST.get('index', 0))

try:
template = "webclient/annotations/metadata_hierarchy.html"
Expand All @@ -796,10 +785,8 @@ def load_metadata_acquisition(request, c_type, c_id, conn=None, share_id=None, *
TODO: urls regex should make sure that c_type is only 'image' OR 'well'
"""

try:
index = int(request.REQUEST['index'])
except:
index = 0
# the index of a field within a well
index = int(request.REQUEST.get('index', 0))

try:
if c_type in ("share", "discussion"):
Expand Down Expand Up @@ -995,8 +982,6 @@ def batch_annotate(request, conn=None, **kwargs):
Local File form and Comment form are loaded. Other forms are loaded via AJAX
"""

index = int(request.REQUEST.get('index', 0))

oids = getObjects(request, conn)
selected = getIds(request)
initial = {'selected':selected, 'images':oids['image'], 'datasets': oids['dataset'], 'projects':oids['project'],
Expand Down Expand Up @@ -1193,10 +1178,8 @@ def manage_action_containers(request, action, o_type=None, o_id=None, conn=None,
"""
template = None

try:
index = int(request.REQUEST['index'])
except:
index = None
# the index of a field within a well
index = int(request.REQUEST.get('index', 0))

manager = None
if o_type in ("dataset", "project", "image", "screen", "plate", "acquisition", "well","comment", "file", "tag", "tagset"):
Expand Down

0 comments on commit c35bac9

Please sign in to comment.