Victor Gavro  committed 77080d3

Allow to disable remote IP checking in CALLBACK_IPS

  • Participants
  • Parent commits 3aae17f
  • Branches default

Comments (0)

Files changed (2)

File smsgate/

 # Allow connection to callback view only for specified IPs.
+# Set to None if you want to disable IP checking (NOT RECOMMENDED).
 # After this days count of no delivery report SMS status set to expired.

File smsgate/

     This view function process request from sms gateway with SMS statuses
     and saves them to database.
-    if request.META['REMOTE_ADDR'] not in settings.CALLBACK_IPS:
+    if settings.CALLBACK_IPS and \
+       request.META['REMOTE_ADDR'] not in settings.CALLBACK_IPS:
         return HttpResponse(status=403)
     if not hasattr(backend, 'sms_status_callback'):
         raise NotImplementedError('Module %s does not support sms_callback' %