Commit 6eb580a2 authored by Giorgos Korfiatis's avatar Giorgos Korfiatis Committed by Georgios D. Tsoukalas
Browse files

Check user status when creating project membership

parent c8385b9b
......@@ -462,7 +462,10 @@ def create_membership(project, user):
if isinstance(user, int):
user = get_user_by_id(user)
#TODO: low level check on whether user is registered in quotaholder
if not user.is_active:
m = _(astakos_messages.ACCOUNT_NOT_ACTIVE)
raise PermissionDenied(m)
m = ProjectMembership(
project=project,
person=user,
......
......@@ -38,6 +38,7 @@ ACCOUNT_ALREADY_ACTIVE = 'This account is already active.'
ACCOUNT_PENDING_ACTIVATION = 'Your account request is pending activation.'
ACCOUNT_PENDING_MODERATION = 'Your account request is pending moderation.'
ACCOUNT_INACTIVE = 'Your account is disabled.'
ACCOUNT_NOT_ACTIVE = 'User account is not active.'
ACCOUNT_RESEND_ACTIVATION = 'It seems that an activation email has been sent to you, but you have not followed the activation link. <a href="%(send_activation_url)s">Resend activation email.</a>'
INACTIVE_ACCOUNT_CHANGE_EMAIL = ''.join([ACCOUNT_RESEND_ACTIVATION, ' Or <a href="%(signup_url)s">Send activation to a new email.</a>'])
......
......@@ -312,9 +312,6 @@ class AstakosUserManager(UserManager):
def verified(self):
return self.filter(email_verified=True)
def verified(self):
return self.filter(email_verified=True)
def uuid_catalog(self, l=None):
"""
Returns a uuid to username mapping for the uuids appearing in l.
......@@ -2607,7 +2604,7 @@ def sync_users(users, sync=True, retries=3, retry_wait=1.0):
return _sync_users(users, sync)
def sync_all_users(sync=True, retries=3, retry_wait=1.0):
users = AstakosUser.objects.filter(is_active=True)
users = AstakosUser.objects.verified()
return sync_users(users, sync, retries, retry_wait)
class ProjectMembershipHistory(models.Model):
......
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