Projet

Général

Profil

0001-forms-use-correct-live-evaluation-URL-when-editing-a.patch

Frédéric Péters, 24 mars 2019 10:58

Télécharger (1,61 ko)

Voir les différences:

Subject: [PATCH] forms: use correct live evaluation URL when editing an
 existing form (#31668)

 wcs/forms/root.py                    | 4 +++-
 wcs/qommon/static/js/qommon.forms.js | 3 ++-
 2 files changed, 5 insertions(+), 2 deletions(-)
wcs/forms/root.py
519 519
        return False
520 520

  
521 521
    def create_form(self, *args, **kwargs):
522
        return self.formdef.create_form(*args, **kwargs)
522
        form = self.formdef.create_form(*args, **kwargs)
523
        form.attrs['data-live-url'] = self.formdef.get_url() + 'live'
524
        return form
523 525

  
524 526
    def create_view_form(self, *args, **kwargs):
525 527
        return self.formdef.create_view_form(*args, **kwargs)
wcs/qommon/static/js/qommon.forms.js
73 73
    if (data && data.modified_field) {
74 74
      new_data += '&modified_field_id=' + data.modified_field;
75 75
    }
76
    var live_url = $(this).data('live-url');
76 77
    live_evaluation = $.ajax({
77 78
      type: 'POST',
78
      url: window.location.pathname + 'live',
79
      url: live_url,
79 80
      dataType: 'json',
80 81
      data: new_data,
81 82
      headers: {'accept': 'application/json'},
82
-