Commit 3b40b37a authored by Olga Brani's avatar Olga Brani
Browse files

Merge branch 'latest-quota' of https://code.grnet.gr/git/synnefo into latest-quota

parents e4ed688f 2aa79fd0
......@@ -486,7 +486,7 @@ def accept_membership(project, user, request_user=None):
dictionary={'object':membership.project.application, 'action':'accepted'})
notification.send()
except NotificationError, e:
logger.error(e.messages)
logger.error(e.message)
return membership
def reject_membership(project, user, request_user=None):
......@@ -514,7 +514,7 @@ def reject_membership(project, user, request_user=None):
dictionary={'object':membership.project.application, 'action':'rejected'})
notification.send()
except NotificationError, e:
logger.error(e.messages)
logger.error(e.message)
return membership
def remove_membership(project, user, request_user=None):
......@@ -543,7 +543,7 @@ def remove_membership(project, user, request_user=None):
dictionary={'object':membership.project.application, 'action':'removed'})
notification.send()
except NotificationError, e:
logger.error(e.messages)
logger.error(e.message)
return membership
def leave_project(project_application_id, user_id):
......@@ -615,4 +615,4 @@ def approve_application(application):
dictionary={'object':application})
notification.send()
except NotificationError, e:
logger.error(e.messages)
logger.error(e.message)
......@@ -1665,7 +1665,7 @@ class Project(models.Model):
# dictionary={'object':self.application}
# ).send()
# except NotificationError, e:
# logger.error(e.messages)
# logger.error(e.message)
def suspend(self):
self.last_approval_date = None
......@@ -1681,7 +1681,7 @@ class Project(models.Model):
# dictionary={'object':self.application}
# ).send()
# except NotificationError, e:
# logger.error(e.messages)
# logger.error(e.message)
class ProjectMembership(models.Model):
......@@ -1785,23 +1785,21 @@ class ProjectMembership(models.Model):
synced_application = self.application
if synced_application is not None:
# first, inverse all current limits, and index them by resource name
cur_grants = synced_application.resource_grants.all()
for grant in cur_grants:
sub_append(QuotaLimits(
holder = holder,
resource = grant.resource.name,
resource = str(grant.resource),
capacity = grant.member_capacity,
import_limit = grant.member_import_limit,
export_limit = grant.member_export_limit))
if not remove:
# second, add each new limit to its inverted current
new_grants = self.pending_application.projectresourcegrant_set.all()
for new_grant in new_grants:
add_append(QuotaLimits(
holder = holder,
resource = new_grant.resource.name,
resource = str(new_grant.resource),
capacity = new_grant.member_capacity,
import_limit = new_grant.member_import_limit,
export_limit = new_grant.member_export_limit))
......
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