File tree 2 files changed +32
-0
lines changed 2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change
1
+ import logging
2
+
3
+
4
+ logger = logging .getLogger (__name__ )
5
+
1
6
2
7
class DemoCallbackException (Exception ):
3
8
"A dummy callback exception"
@@ -19,3 +24,23 @@ def callback_exception(*args, **kwargs):
19
24
It'll raise an exception
20
25
"""
21
26
raise DemoCallbackException ()
27
+
28
+
29
+ def callback_success_message (request ):
30
+ """
31
+ This function will be called a form post-save/create.
32
+
33
+ It adds a logging message
34
+ """
35
+ logger .info ('Sucessfully recorded form :)' )
36
+ return True
37
+
38
+
39
+ def callback_fail_message (request ):
40
+ """
41
+ This function will be called a form post-save/create.
42
+
43
+ It adds a logging message (error)
44
+ """
45
+ logger .error ('Form storing has failed :(' )
46
+ return True
Original file line number Diff line number Diff line change 115
115
]
116
116
117
117
CORS_ORIGIN_ALLOW_ALL = True
118
+
119
+
120
+ # Formidable call back post-create/update
121
+ FORMIDABLE_POST_CREATE_CALLBACK_SUCCESS = 'demo.callback_success_message'
122
+ FORMIDABLE_POST_UPDATE_CALLBACK_SUCCESS = 'demo.callback_success_message'
123
+ FORMIDABLE_POST_CREATE_CALLBACK_FAIL = 'demo.callback_fail_message'
124
+ FORMIDABLE_POST_UPDATE_CALLBACK_FAIL = 'demo.callback_fail_message'
You can’t perform that action at this time.
0 commit comments