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)
Beispiel #3
0
 def test_1(self, qh):
     qh.return_value = [21, 25, 28]
     pending = quotas.resolve_pending_commissions()
     self.assertEqual(pending, ([25], [28, 21]))
Beispiel #4
0
 def test_no_pending(self, qh):
     qh.return_value = []
     pending = quotas.resolve_pending_commissions()
     self.assertEqual(pending, ([], []))
Beispiel #5
0
 def test_1(self, qh):
     qh.return_value = [21, 25, 28]
     pending = quotas.resolve_pending_commissions()
     self.assertEqual(pending, ([25], [28, 21]))
Beispiel #6
0
 def test_no_pending(self, qh):
     qh.return_value = []
     pending = quotas.resolve_pending_commissions()
     self.assertEqual(pending, ([], []))