def handle(self, *args, **options):
        fix = options["fix"]

        accepted, rejected = quotas.resolve_pending_commissions()

        if accepted:
            self.stdout.write("Pending accepted commissions:\n %s\n" % list_to_string(accepted))

        if rejected:
            self.stdout.write("Pending rejected commissions:\n %s\n" % list_to_string(rejected))

        if fix and (accepted or rejected):
            self.stdout.write("Fixing pending commissions..\n")
            quotas.reconcile_resolve_commissions(accept=accepted, reject=rejected, strict=False)
    def handle(self, *args, **options):
        fix = options['fix']

        accepted, rejected = quotas.resolve_pending_commissions()

        if accepted:
            self.stdout.write("Pending accepted commissions:\n %s\n" %
                              list_to_string(accepted))

        if rejected:
            self.stdout.write("Pending rejected commissions:\n %s\n" %
                              list_to_string(rejected))

        if fix and (accepted or rejected):
            self.stdout.write("Fixing pending commissions..\n")
            quotas.reconcile_resolve_commissions(accept=accepted,
                                                 reject=rejected,
                                                 strict=False)
Esempio n. 3
0
 def test_1(self, qh):
     qh.return_value = [21, 25, 28]
     pending = quotas.resolve_pending_commissions()
     self.assertEqual(pending, ([25], [28, 21]))
Esempio n. 4
0
 def test_no_pending(self, qh):
     qh.return_value = []
     pending = quotas.resolve_pending_commissions()
     self.assertEqual(pending, ([], []))
Esempio n. 5
0
 def test_1(self, qh):
     qh.return_value = [21, 25, 28]
     pending = quotas.resolve_pending_commissions()
     self.assertEqual(pending, ([25], [28, 21]))
Esempio n. 6
0
 def test_no_pending(self, qh):
     qh.return_value = []
     pending = quotas.resolve_pending_commissions()
     self.assertEqual(pending, ([], []))