Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- root@noc:/opt/noc # hg diff
- diff -r 9e45c6372597 fm/apps/classificationrule/js/TestForm.js
- --- a/fm/apps/classificationrule/js/TestForm.js Fri Oct 11 07:42:44 2013 +0400
- +++ b/fm/apps/classificationrule/js/TestForm.js Tue Oct 15 13:49:46 2013 +0400
- @@ -56,7 +56,8 @@
- //
- onTest: function() {
- var me = this,
- - data = me.dataField.getValue();
- + data = me.dataField.getValue(),
- + fd = me.app.getFormData();
- // @todo: Validation
- Ext.Ajax.request({
- url: "/fm/classificationrule/test/",
- @@ -65,7 +66,7 @@
- jsonData: {
- data: data,
- patterns: me.app.getPatterns(),
- - event_class: me.app.currentRecord.get("event_class")
- + event_class: fd["event_class"]
- },
- success: function(response) {
- var me = this;
- diff -r 9e45c6372597 fm/apps/classificationrule/views.py
- --- a/fm/apps/classificationrule/views.py Fri Oct 11 07:42:44 2013 +0400
- +++ b/fm/apps/classificationrule/views.py Tue Oct 15 13:49:46 2013 +0400
- @@ -40,7 +40,7 @@
- patterns = []
- result = False
- # Get data
- - data = None
- + data = {}
- vars = {}
- required_vars = set()
- r_patterns = []
- @@ -57,7 +57,11 @@
- errors += ["Event not found: %s" % q["data"]]
- else:
- # Decode json
- - e = self.deserialize(q["data"])
- + try:
- + e = self.deserialize(q["data"])
- + except:
- + errors += ["Cannot decode JSON"]
- + e = None
- if isinstance(e, list):
- e = e[0]
- if not isinstance(e, dict) or "raw_vars" not in e:
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement