Revision 51286d7a
b/snf-astakos-app/astakos/quotaholder/callpoint.py | ||
---|---|---|
148 | 148 |
|
149 | 149 |
if name is None: |
150 | 150 |
name = "" |
151 |
create = Commission.objects.create |
|
152 |
commission = create(clientkey=clientkey, name=name) |
|
153 |
serial = commission.serial |
|
154 | 151 |
|
155 | 152 |
operations = Operations() |
153 |
provisions_to_create = [] |
|
156 | 154 |
|
157 | 155 |
provisions = self._provisions_to_list(provisions) |
158 | 156 |
keys = [key for (key, value) in provisions] |
... | ... | |
187 | 185 |
operations.prepare(Release, th, abs_quantity, force) |
188 | 186 |
|
189 | 187 |
holdings[key] = th |
190 |
Provision.objects.create(serial=commission, |
|
191 |
holder=th.holder, |
|
192 |
source=th.source, |
|
193 |
resource=th.resource, |
|
194 |
quantity=quantity) |
|
188 |
provisions_to_create.append((key, quantity)) |
|
195 | 189 |
|
196 | 190 |
except QuotaholderError: |
197 | 191 |
operations.revert() |
198 | 192 |
raise |
199 | 193 |
|
200 |
return serial |
|
194 |
commission = Commission.objects.create(clientkey=clientkey, name=name) |
|
195 |
for (holder, source, resource), quantity in provisions_to_create: |
|
196 |
Provision.objects.create(serial=commission, |
|
197 |
holder=holder, |
|
198 |
source=source, |
|
199 |
resource=resource, |
|
200 |
quantity=quantity) |
|
201 |
|
|
202 |
return commission.serial |
|
201 | 203 |
|
202 | 204 |
def _log_provision(self, |
203 | 205 |
commission, provision, holding, log_time, reason): |
Also available in: Unified diff