TWO APP.PY FILES HANDLING THE SAME MESSAGE

12 views
Skip to first unread message

dannette opot

unread,
Apr 30, 2013, 1:37:24 AM4/30/13
to rapi...@googlegroups.com, Victor Miclovich A. K., Victor Were
The rct_notify_app.py execute the false statement in the rct_app.py.Yet the message formats supplied are different. Help.

dannette opot

unread,
Apr 30, 2013, 2:16:08 AM4/30/13
to rapi...@googlegroups.com
I forgot to attach the files . . .  here they are :

rct_app.py
rct_notify_app.py

bayo opadeyi

unread,
Apr 30, 2013, 3:19:51 AM4/30/13
to rapidsms
Hi,

I see a lot of "return" statements in rct_app.py for e.g. lines 114, 119, 122, 132, ...
I believe you want to "return True" to indicate that the message has been handled?

Regards


--
You received this message because you are subscribed to the Google Groups "rapidsms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rapidsms+u...@googlegroups.com.
To post to this group, send email to rapi...@googlegroups.com.
Visit this group at http://groups.google.com/group/rapidsms?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
@boyombo
http://bayo.opadeyi.net
A designer knows he has achieved perfection not when there is nothing left to add, but when there is nothing left to take away.

 --Antoine de Saint-Exupery

dannette opot

unread,
Apr 30, 2013, 3:23:45 AM4/30/13
to rapi...@googlegroups.com
@Bayo Opadeyi that's true... "return True" should indicate that the message has been handled.

Tim Akinbo

unread,
Apr 30, 2013, 5:38:44 AM4/30/13
to RapidSMS
After retuning True like Bayo suggested, does this solve the problem?

I think generally, you will not want to have that else statement that response with something similar to "Wrong message format.rct_notify.app.py!" as this will produce that and the message will still be propagated to the next app.

You're better of adding the "rapidsms.contrib.default" app to your INSTALLED_APPS settings and setting DEFAULT_RESPONSE in your settings file to the response you want to generate if the message format is wrong (i.e. it neither starts with "va" or "rct".

HTH

Tim Akinbo
Reply all
Reply to author
Forward
0 new messages