Projet

Général

Profil

0001-formdata-add-anonymised-parameter-to-get_json_dict.patch

Benjamin Dauvergne, 04 décembre 2015 11:58

Télécharger (986 octets)

Voir les différences:

Subject: [PATCH 1/2] formdata: add anonymised parameter to get_json_dict()

When anonymised=True, field with the anonymised flag are not include in the JSON
export.
 wcs/formdata.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
wcs/formdata.py
95 95
            del d[k]
96 96

  
97 97

  
98
def get_json_dict(fields, data, include_files=True):
98
def get_json_dict(fields, data, include_files=True, anonymised=False):
99 99
    new_data = {}
100 100
    for field in fields:
101
        if anonymised and field.anonymised:
102
            continue
101 103
        if not field.varname: # exports only named fields
102 104
            continue
103 105
        if not include_files and isinstance(field, FileField):
104
-