Revision 570015d2 snf-astakos-app/astakos/im/models.py
b/snf-astakos-app/astakos/im/models.py | ||
---|---|---|
1757 | 1757 |
self.state = self.APPROVED |
1758 | 1758 |
self.response_date = now |
1759 | 1759 |
self.save() |
1760 |
return project |
|
1760 | 1761 |
|
1761 | 1762 |
@property |
1762 | 1763 |
def member_join_policy_display(self): |
... | ... | |
2270 | 2271 |
self._set_history_item(reason='CANCEL') |
2271 | 2272 |
self.delete() |
2272 | 2273 |
|
2273 |
def get_diff_quotas(self, sub_list=None, add_list=None): |
|
2274 |
def get_diff_quotas(self, sub_list=None, add_list=None, |
|
2275 |
pending_application=None): |
|
2274 | 2276 |
if sub_list is None: |
2275 | 2277 |
sub_list = [] |
2276 | 2278 |
|
... | ... | |
2291 | 2293 |
capacity = grant.member_capacity, |
2292 | 2294 |
)) |
2293 | 2295 |
|
2294 |
pending_application = self.pending_application |
|
2295 | 2296 |
if pending_application is not None: |
2296 | 2297 |
new_grants = pending_application.projectresourcegrant_set.all() |
2297 | 2298 |
for new_grant in new_grants: |
... | ... | |
2303 | 2304 |
|
2304 | 2305 |
return (sub_list, add_list) |
2305 | 2306 |
|
2307 |
def get_pending_application(self): |
|
2308 |
project = self.project |
|
2309 |
if project.is_deactivated(): |
|
2310 |
return None |
|
2311 |
if self.state not in self.ACTUALLY_ACCEPTED: |
|
2312 |
return None |
|
2313 |
return project.application |
|
2314 |
|
|
2306 | 2315 |
|
2307 | 2316 |
class Serial(models.Model): |
2308 | 2317 |
serial = models.AutoField(primary_key=True) |
Also available in: Unified diff