Commit 8d753271 authored by Giorgos Korfiatis's avatar Giorgos Korfiatis

Disallow commission when source == target

parent 1b213ebc
......@@ -506,6 +506,11 @@ class QuotaholderDjangoDBCallpoint(Callpoint):
checked = []
for entity, resource, quantity in provisions:
if entity == target:
m = "Cannot issue commission from an entity to itself (%s)" % (
entity,)
raise InvalidDataError(m)
ent_res = entity, resource
if ent_res in checked:
m = "Duplicate provision for %s.%s" % ent_res
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment