N
Novu5mo ago
IakMastro

Bug with Patch Subscriber

Hello, I have this code
notifications_api = session.get_notifications()
subscriber = SubscriberDto(
subscriber_id=body.user_id,
phone=body.phone
)
await notifications_api.update_subscriber(subscriber)
# Do something temporary with the number
subscriber = SubscriberDto(
subscriber_id=body.user_id,
phone=None
)
await notifications_api.update_subscriber(subscriber)
notifications_api = session.get_notifications()
subscriber = SubscriberDto(
subscriber_id=body.user_id,
phone=body.phone
)
await notifications_api.update_subscriber(subscriber)
# Do something temporary with the number
subscriber = SubscriberDto(
subscriber_id=body.user_id,
phone=None
)
await notifications_api.update_subscriber(subscriber)
It works fine, however instead of deleting the phone, it deletes the email. I don't think that is how it supposed to have worked.
4 Replies
Novu_Bot
Novu_Bot5mo ago
@IakMastro, you just advanced to level 1!
Pawan Jain
Pawan Jain5mo ago
@IakMastro Thanks for sharing. Is above code of python SDK?
IakMastro
IakMastro5mo ago
Yes
Pawan Jain
Pawan Jain5mo ago
@IakMastro We will revert back to you after checking with python sdk maintainer cc:- @unicodeveloper