Projet

Général

Profil

0001-api-don-t-crash-api-user-forms-drafts-when-there-are.patch

Frédéric Péters, 19 novembre 2018 12:02

Télécharger (930 octets)

Voir les différences:

Subject: [PATCH] api: don't crash /api/user/{forms,drafts} when there are no
 formdefs (#28132)

 wcs/api.py | 3 +++
 1 file changed, 3 insertions(+)
wcs/api.py
555 555
        return json.dumps(user_info, cls=misc.JSONEncoder)
556 556

  
557 557
    def get_user_forms(self, user):
558
        if FormDef.count() == 0:
559
            # early return, this avoids running a query against a missing SQL view.
560
            return []
558 561
        if get_publisher().is_using_postgresql() and not get_request().form.get('full') == 'on':
559 562
            from wcs import sql
560 563
            from qommon.storage import Equal
561
-