Skip to content
This repository was archived by the owner on Sep 26, 2018. It is now read-only.

Subscriber balance zero out when validity expire (Client dependent)#42

Open
shivkumarsah wants to merge 1 commit into
facebookarchive:masterfrom
piyushabad88:sprint2_pr_balance_zero_out
Open

Subscriber balance zero out when validity expire (Client dependent)#42
shivkumarsah wants to merge 1 commit into
facebookarchive:masterfrom
piyushabad88:sprint2_pr_balance_zero_out

Conversation

@shivkumarsah

Copy link
Copy Markdown
Contributor

Please review subscriber balance zero out feature:

This PR is linked with #40

@kkroo kkroo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how has this been tested?

Comment thread cloud/endagaweb/tasks.py
credit_balance = crdt.PNCounter("default").serialize()
print "Validity expired for Susbcribers %s setting balance to 0" % (
[subscriber.imsi for subscriber in subscribers],)
subscribers.update(crdt_balance=credit_balance) No newline at end of file

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just update the value to zero?

Comment thread cloud/endagaweb/tasks.py
valid_through__lte=today)
if not subscribers:
return # Do nothing
credit_balance = crdt.PNCounter("default").serialize()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you don't need to deal with crdt's. You can use the getter/setter Subscriber property balance

@shivkumarsah shivkumarsah changed the title Subscriber balance zero out when validity expire - DO NOT MERGE Subscriber balance zero out when validity expire (Client dependent) Aug 4, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants