~psivaa/uci-engine/lander-jenkins-with-proxy

« back to all changes in this revision

Viewing changes to ppa-assigner/ppa_assigner/api.py

  • Committer: Evan Dandrea
  • Date: 2014-03-14 10:37:28 UTC
  • mfrom: (387 ubuntu-ci-services-itself)
  • mto: This revision was merged to the branch mainline in revision 389.
  • Revision ID: evan.dandrea@canonical.com-20140314103728-i9wqk4r17gsya24h
Merge with trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
106
106
        queryset = PPA.objects.none()
107
107
 
108
108
    def get_list(self, request, **kwargs):
109
 
        lp = settings.LAUNCHPAD_PPA_USER is not None
 
109
        lp = settings.LAUNCHPAD_USER is not None
 
110
        lp = lp and settings.LAUNCHPAD_PPA_OWNER is not None
110
111
        lp = lp and settings.OAUTH_TOKEN is not None
111
112
        lp = lp and settings.OAUTH_TOKEN_SECRET is not None
112
113
        lp = lp and settings.OAUTH_CONSUMER_KEY is not None
114
115
        status = JSONStatus()
115
116
        status.add_true_false('launchpad configured', lp, lp)
116
117
 
117
 
        count = PPA.objects.all().count()
 
118
        is_private = settings.PRIVATE_ONLY
 
119
        status.add_true_false('private ppas only', is_private, is_private)
 
120
 
 
121
        total_ppas = PPA.objects.filter(private=is_private)
 
122
        count = total_ppas.count()
118
123
        status.add_true_false('total ppas', count, count > 0)
119
124
 
120
 
        count = PPA.objects.filter(state=PPA.AVAILABLE).count()
 
125
        count = total_ppas.filter(state=PPA.AVAILABLE).count()
121
126
        status.add_true_false('available ppas', count, count > 0)
122
127
 
123
128
        try: