Revision ab38ac31

b/snf-cyclades-app/synnefo/ui/static/snf/js/neutron.js
21 21
    
22 22
    // Neutron base model, extending existing synnefo model
23 23
    models.NetworkModel = snfmodels.Model.extend({
24
      api_type: 'network'
24
      api_type: 'network',
25
      toJSON: function() {
26
        var res = {};
27
        _.each(this.attributes, function(attr, key) {
28
          if (attr instanceof bb.Collection) {
29
            attr = "[Collection object]";
30
          }
31
          res[key] = attr;
32
        });
33
        return res;
34
      }
25 35
    });
26 36
    
27 37
    // Neutron base collection, common neutron collection params are shared
b/snf-cyclades-app/synnefo/ui/static/snf/js/ui/web/ui_feedback_view.js
125 125
        },
126 126

  
127 127
        get_feedback_data: function() {
128
            if (this.collect_data) return JSON.stringify(_.extend({}, snf.collect_user_data(),this.extra_data));
128
            if (this.collect_data) {
129
              var user_data = snf.collect_user_data();
130
              user_data.errors = [];
131
              try {
132
                var user_data_str = JSON.stringify(user_data);
133
              } catch (err) {
134
                console.error(err);
135
                user_data = {'error': 'cannot parse user data to string'};
136
              }
137
              return JSON.stringify(_.extend({}, user_data, this.extra_data));
138
            }
129 139
        },
130 140
        
131 141
        onOpen: function() {

Also available in: Unified diff