diff --git a/snf-pithos-app/pithos/api/management/commands/reconcile-resources-pithos.py b/snf-pithos-app/pithos/api/management/commands/reconcile-resources-pithos.py index 63a0c5f939868f935a443ace227a0b92e6c2bd60..b9fa0418c403ef2f9ff1ddefc4d8827c1f788c5b 100644 --- a/snf-pithos-app/pithos/api/management/commands/reconcile-resources-pithos.py +++ b/snf-pithos-app/pithos/api/management/commands/reconcile-resources-pithos.py @@ -77,8 +77,10 @@ class Command(NoArgsCommand): users = set(db_usage.keys()) if userid and userid not in users: - self.stdout.write("User '%s' does not exist in DB!\n" % userid) - return + if backend._lookup_account(userid) is None: + self.stdout.write("User '%s' does not exist in DB!\n" % + userid) + return # Get holding from Quotaholder try: @@ -161,4 +163,4 @@ def create_provision(provision_info): return {"holder": user, "source": DEFAULT_SOURCE, "resource": resource, - "quantity": db_value - qh_value} + "quantity": int(db_value - qh_value)}