unicefuganda/rapidsms-httprouter — comment on commit 9e11aff5549e840773fc121e5dcda103e5bae185
File:  line 0
By daveycrockett:

This is an EXTREMELY BAD IDEA, for two reasons:

1) __iregex filters aren't efficient
2) this means that any outgoing messages with status 'Q' and a connection that is an alpha string will REMAIN QUEUED, causing the messenger to hang

You should instead change line 73...if you MUST use iregex, change the line from msgs.values_list to msgs.exclude(...).values_list().

Better still, you could just change the Connection.objects.get_or_create login in handle_incoming, immediately discarding any messages that come in from non-numeric numbers (this would be preferred).