Skip to content
This repository has been archived by the owner on Feb 8, 2018. It is now read-only.

cta percentage is 149% #3841

Closed
chadwhitacre opened this issue Oct 21, 2015 · 3 comments
Closed

cta percentage is 149% #3841

chadwhitacre opened this issue Oct 21, 2015 · 3 comments
Assignees
Milestone

Comments

@chadwhitacre
Copy link
Contributor

sigh

We suck at math. :-(

screen shot 2015-10-21 at 5 01 42 pm

@yifeiwu
Copy link
Contributor

yifeiwu commented Oct 21, 2015

def update_cta(website):
nusers = website.db.one("""
    SELECT nusers FROM paydays
    ORDER BY ts_end DESC LIMIT 1
""", default=0)
nreceiving_from = website.db.one("""
    SELECT nreceiving_from
      FROM teams
     WHERE slug = 'Gratipay'
""", default=0)
website.support_current = cur = int(round(nreceiving_from / nusers * 100)) if nusers else 0

https://github.com/gratipay/gratipay.com/blob/f9749d98d2853701968adf437e9436deca1741aa/gratipay/utils/__init__.py
I think the math looks ok, I'm guessing something went wrong in the db?

@rohitpaulk
Copy link
Contributor

Looks like nusers FROM paydays doesn't include the people who haven't been charged because of the new arrears system - and nreceiving_from FROM teams does.

@rohitpaulk
Copy link
Contributor

Closed in #3848

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants