def _get_resource_list(self, request): """Rather than adding a 'users' method to the resource, we compute users list here, because users may be not still bound to the correspondent Person. This block is in fact used only for Admin purposes during a specific stage of the registration process. """ # User list pr = ParamRole.get_role(GAS_MEMBER, gas=request.resource) users = pr.get_users() users = users.filter(registrationprofile__activation_key=RegistrationProfile.ACTIVATED) return users.order_by('last_name', 'first_name')
def _get_resource_list(self, request): """Rather than adding a 'users' method to the resource, we compute users list here, because users may be not still bound to the correspondent Person. This block is in fact used only for Admin purposes during a specific stage of the registration process. """ # User list pr = ParamRole.get_role(SUPPLIER_REFERRER, supplier=request.resource) users = pr.get_users() users = users.filter( registrationprofile__activation_key=RegistrationProfile.ACTIVATED) return users.order_by('last_name', 'first_name')
def _get_resource_list(self, request): """Retrieve all users who are GAS Members and have confirmed their emails. IMPORTANT: retrieve also suspended GAS Members. """ # User list users_email_confirmed = User.objects.filter(registrationprofile__activation_key=RegistrationProfile.ACTIVATED) users = users_email_confirmed.filter(person__gasmember__gas=request.resource) users = users.extra(select={"is_active_in_this_gas" : "NOT gas_gasmember.is_suspended" }) # for u in users: # print("%s is_active_in_this_gas=%s" % (u, u.is_active_in_this_gas)) return users.order_by('last_name', 'first_name')
def _get_resource_list(self, request): """Retrieve all users who are GAS Members and have confirmed their emails. IMPORTANT: retrieve also suspended GAS Members. """ # User list users_email_confirmed = User.objects.filter( registrationprofile__activation_key=RegistrationProfile.ACTIVATED) users = users_email_confirmed.filter( person__gasmember__gas=request.resource) users = users.extra( select={"is_active_in_this_gas": "NOT gas_gasmember.is_suspended"}) # for u in users: # print("%s is_active_in_this_gas=%s" % (u, u.is_active_in_this_gas)) return users.order_by('last_name', 'first_name')