Revision a989b48e snf-astakos-app/astakos/im/functions.py
b/snf-astakos-app/astakos/im/functions.py | ||
---|---|---|
69 | 69 |
from astakos.im.models import ( |
70 | 70 |
AstakosUser, Invitation, ProjectMembership, ProjectApplication, Project, |
71 | 71 |
UserSetting, |
72 |
PendingMembershipError, get_resource_names, new_chain) |
|
72 |
PendingMembershipError, get_resource_names, new_chain, |
|
73 |
users_quotas) |
|
73 | 74 |
from astakos.im.project_notif import ( |
74 | 75 |
membership_change_notify, membership_enroll_notify, |
75 | 76 |
membership_request_notify, membership_leave_request_notify, |
76 | 77 |
application_submit_notify, application_approve_notify, |
77 | 78 |
application_deny_notify, |
78 | 79 |
project_termination_notify, project_suspension_notify) |
79 |
from astakos.im.endpoints.qh import qh_register_user_with_quotas, qh_get_quota |
|
80 |
from astakos.im.endpoints.qh import ( |
|
81 |
register_users, register_quotas, qh_get_quota) |
|
80 | 82 |
|
81 | 83 |
import astakos.im.messages as astakos_messages |
82 | 84 |
|
... | ... | |
310 | 312 |
if not user.activation_sent: |
311 | 313 |
user.activation_sent = datetime.now() |
312 | 314 |
user.save() |
313 |
qh_register_user_with_quotas(user)
|
|
315 |
register_user_with_quotas(user) |
|
314 | 316 |
send_helpdesk_notification(user, helpdesk_email_template_name) |
315 | 317 |
send_greeting(user, email_template_name) |
316 | 318 |
|
... | ... | |
388 | 390 |
super(SendNotificationError, self).__init__() |
389 | 391 |
|
390 | 392 |
|
393 |
def register_user_with_quotas(user): |
|
394 |
rejected = register_users([user]) |
|
395 |
if not rejected: |
|
396 |
quotas = users_quotas([user]) |
|
397 |
register_quotas(quotas) |
|
398 |
|
|
399 |
|
|
391 | 400 |
def get_quota(users): |
392 | 401 |
resources = get_resource_names() |
393 | 402 |
return qh_get_quota(users, resources) |
Also available in: Unified diff