Project

General

Profile

0001-forms-remove-public-listing-dead-code-13126.patch

Frédéric Péters, 08 September 2016 09:23 PM

Download (1.76 KB)

View differences:

Subject: [PATCH] forms: remove public listing dead code (#13126)

 wcs/forms/root.py | 19 +------------------
 1 file changed, 1 insertion(+), 18 deletions(-)
wcs/forms/root.py
208 208
        return TrackingCodeDirectory(component, self.formdef)
209 209

  
210 210
class FormPage(Directory):
211
    _q_exports = ['', 'listing', 'tempfile', 'tokens', 'schema', 'tryauth',
211
    _q_exports = ['', 'tempfile', 'tokens', 'schema', 'tryauth',
212 212
            'auth', 'qrcode', 'autosave', 'code', 'removedraft']
213 213

  
214 214
    def __init__(self, component):
......
1090 1090
        r += htmltext('<a href="%s">%s</a>') % (homepage, _('Back Home'))
1091 1091
        return r.getvalue()
1092 1092

  
1093
    def listing(self):
1094
        if not self.formdef.is_user_allowed_read(get_request().user):
1095
            raise errors.AccessForbiddenError()
1096
        get_response().breadcrumb.append( ('listing', _('Listing')) )
1097
        self.html_top('%s - %s' % (_('Listing'), self.formdef.name))
1098
        r = TemplateIO(html=True)
1099

  
1100
        fields = []
1101
        for field in self.formdef.fields:
1102
            if hasattr(field, str('get_view_value')) and field.in_listing:
1103
                fields.append(field)
1104

  
1105
        r += FormDefUI(self.formdef).listing(fields, 'all', include_form=True)
1106

  
1107
        r += htmltext('<p><a href="..">%s</a></p>') % _('Back')
1108
        return r.getvalue()
1109

  
1110 1093
    def tryauth(self):
1111 1094
        return tryauth(self.formdef.get_url())
1112 1095

  
1113
-