django-push-notifications icon indicating copy to clipboard operation
django-push-notifications copied to clipboard

AttributeError: 'unicode' object has no attribute 'create_connection' in 1.6

Open mhsiddiqui opened this issue 7 years ago • 1 comments

I was using django-push-notifications==1.4.1 and it was working fine. But when I upgraded it on 1.6, I start getting following error.

raised unexpected: AttributeError("'unicode' object has no attribute 'create_connection'",)
Traceback (most recent call last):
  File "/home/hassan/venv/ballogy/local/lib/python2.7/site-packages/celery/app/trace.py", line 374, in trace_task
    R = retval = fun(*args, **kwargs)
  File "/home/hassan/venv/ballogy/local/lib/python2.7/site-packages/celery/app/trace.py", line 629, in __protected_call__
    return self.run(*args, **kwargs)
  File "/home/hassan/Project/ballogy/ballogyApi/tasks/notification_tasks.py", line 41, in send_notification_task
    data=data
  File "/home/hassan/Project/ballogy/ballogyApi/tasks/notification_tasks.py", line 16, in send_notification
    android_response_function, ios_response_function, bulk, **data)
  File "/home/hassan/Project/ballogy/ballogyApi/utils/notification_utils.py", line 37, in perform_notification_process
    to_user, android_response_function, ios_response_function, bulk, **kwargs)
  File "/home/hassan/Project/ballogy/ballogyApi/utils/notification_utils.py", line 47, in send_notification_to_user
    to_user, android_response_function, ios_response_function, *args, **kwargs)
  File "/home/hassan/Project/ballogy/ballogyApi/utils/notification_utils.py", line 90, in send_single_notification
    badge=not_count + total_requests)
  File "/home/hassan/venv/ballogy/local/lib/python2.7/site-packages/push_notifications/models.py", line 167, in send_message
    **kwargs
  File "/home/hassan/venv/ballogy/local/lib/python2.7/site-packages/push_notifications/apns.py", line 113, in apns_send_message
    certfile=certfile, **kwargs
  File "/home/hassan/venv/ballogy/local/lib/python2.7/site-packages/push_notifications/apns.py", line 66, in _apns_send
    client = _apns_create_socket(certfile=certfile, application_id=application_id)
  File "/home/hassan/venv/ballogy/local/lib/python2.7/site-packages/push_notifications/apns.py", line 38, in _apns_create_socket
    use_alternative_port=get_manager().get_apns_use_alternative_port(application_id)
  File "/home/hassan/venv/ballogy/local/lib/python2.7/site-packages/apns2/client.py", line 39, in __init__
    self._init_connection(use_sandbox, use_alternative_port, proto)
  File "/home/hassan/venv/ballogy/local/lib/python2.7/site-packages/apns2/client.py", line 48, in _init_connection
    self._connection = self.__credentials.create_connection(server, port,
AttributeError: 'unicode' object has no attribute 'create_connection'

mhsiddiqui avatar Feb 22 '18 14:02 mhsiddiqui

Second report of #420.

matthewh avatar Feb 22 '18 14:02 matthewh