Revision a770bf17 snf-astakos-app/astakos/im/models.py
b/snf-astakos-app/astakos/im/models.py | ||
---|---|---|
1356 | 1356 |
related_name='projects_applied', |
1357 | 1357 |
db_index=True) |
1358 | 1358 |
|
1359 |
project = models.ForeignKey('Project', |
|
1360 |
related_name='applications', |
|
1361 |
null=True) |
|
1362 |
|
|
1363 | 1359 |
state = models.CharField(max_length=80, |
1364 | 1360 |
default=UNKNOWN) |
1365 | 1361 |
|
... | ... | |
1479 | 1475 |
raise PermissionDenied(m) # invalid argument |
1480 | 1476 |
except Project.DoesNotExist: |
1481 | 1477 |
pass |
1482 |
project = Project(creation_date=now) |
|
1478 |
project = Project(creation_date=now, name=new_project_name)
|
|
1483 | 1479 |
|
1484 | 1480 |
project.application = self |
1485 | 1481 |
|
... | ... | |
1528 | 1524 |
|
1529 | 1525 |
application = models.OneToOneField( |
1530 | 1526 |
ProjectApplication, |
1531 |
related_name='app_project')
|
|
1527 |
related_name='project') |
|
1532 | 1528 |
last_approval_date = models.DateTimeField(null=True) |
1533 | 1529 |
|
1534 | 1530 |
members = models.ManyToManyField( |
... | ... | |
1555 | 1551 |
|
1556 | 1552 |
@property |
1557 | 1553 |
def is_terminated(self): |
1558 |
return bool(self.termination) |
|
1554 |
return bool(self.termination_date)
|
|
1559 | 1555 |
|
1560 | 1556 |
@property |
1561 | 1557 |
def is_still_approved(self): |
... | ... | |
1831 | 1827 |
|
1832 | 1828 |
if not remove: |
1833 | 1829 |
# second, add each new limit to its inverted current |
1834 |
new_grants = self.pending_application.resource_grants.all()
|
|
1830 |
new_grants = self.pending_application.resourcegrant_set.all()
|
|
1835 | 1831 |
for new_grant in new_grants: |
1836 |
name = grant.resource.name |
|
1832 |
name = new_grant.resource.name
|
|
1837 | 1833 |
cur_grant = tmp_grants.pop(name, None) |
1838 | 1834 |
if cur_grant is None: |
1839 | 1835 |
# if limits on a new resource, set 0 current values |
Also available in: Unified diff