~keitheis/sahana-eden/edentrunk

« back to all changes in this revision

Viewing changes to modules/s3xrc.py

  • Committer: Fran Boon
  • Date: 2010-08-22 00:58:20 UTC
  • mfrom: (185.2.576 vita)
  • Revision ID: fran@aidiq.com-20100822005820-yb60t2si226b63u3
Merge nursix: S3XRC redirects improvements, showcased in RAT

Show diffs side-by-side

added added

removed removed

Lines of Context:
892
892
        if output is not None and isinstance(output, dict):
893
893
            output.update(jr=r)
894
894
 
895
 
        # Redirection
896
 
        if r.next is not None:
897
 
            if r.http == "POST":
898
 
                if isinstance(output, dict):
899
 
                    form = output.get("form", None)
900
 
                    if form and form.errors:
901
 
                        return output
 
895
        # Redirection (makes no sense in GET)
 
896
        if r.next is not None and r.http != "GET":
 
897
            if isinstance(output, dict):
 
898
                form = output.get("form", None)
 
899
                if form and form.errors:
 
900
                    return output
902
901
            self.__dbg("redirecting to %s" % str(r.next))
903
902
            redirect(r.next)
904
903
 
2041
2040
            del vars["format"]
2042
2041
 
2043
2042
        args = []
 
2043
        read = False
2044
2044
 
2045
2045
        component_id = self.component_id
2046
2046
        if id is None:
2047
2047
            id = self.id
 
2048
        else:
 
2049
            read = True
2048
2050
 
2049
2051
        if not representation:
2050
2052
            representation = self.representation
2052
2054
            method = self.method
2053
2055
        elif method=="":
2054
2056
            method = None
2055
 
            if self.component:
2056
 
                component_id = None
2057
 
            else:
2058
 
                id = None
 
2057
            if not read:
 
2058
                if self.component:
 
2059
                    component_id = None
 
2060
                else:
 
2061
                    id = None
2059
2062
        else:
2060
2063
            if id is None:
2061
2064
                id = self.id