File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 8
8
# =============================================================================
9
9
10
10
""" CSW request and response processor """
11
-
11
+ import inspect
12
12
import warnings
13
13
import StringIO
14
14
import random
@@ -591,7 +591,10 @@ def _invoke(self):
591
591
# If skip_caps=True, then self.operations has not been set, so use
592
592
# default URL.
593
593
if hasattr (self , 'operations' ):
594
- for op in self .operations :
594
+ caller = inspect .stack ()[1 ][3 ]
595
+ if caller == 'getrecords2' : caller = 'getrecords'
596
+ try :
597
+ op = self .get_operation_by_name (caller )
595
598
post_verbs = filter (lambda x : x .get ('type' ).lower () == 'post' , op .methods )
596
599
if len (post_verbs ) > 1 :
597
600
# Filter by constraints. We must match a PostEncoding of "XML"
@@ -602,6 +605,8 @@ def _invoke(self):
602
605
xml_post_url = post_verbs [0 ].get ('url' )
603
606
elif len (post_verbs ) == 1 :
604
607
xml_post_url = post_verbs [0 ].get ('url' )
608
+ except : # no such luck, just go with xml_post_url
609
+ pass
605
610
606
611
self .request = cleanup_namespaces (self .request )
607
612
# Add any namespaces used in the "typeNames" attribute of the
You can’t perform that action at this time.
0 commit comments