first setup of pos transaction - add provider, user, organization information of pos to login
This commit is contained in:
17
apps/authentication/services/service.py
Normal file
17
apps/authentication/services/service.py
Normal file
@@ -0,0 +1,17 @@
|
||||
import typing
|
||||
from apps.authentication.models import Organization
|
||||
|
||||
|
||||
def get_users_of_organization(org: Organization) -> typing.Any:
|
||||
""" get users of an organizations """
|
||||
user_relations = org.user_organization.all()
|
||||
|
||||
users_list = [{
|
||||
'name': f"{rel.user.first_name} {rel.user.last_name}",
|
||||
'national_code': rel.user.national_code,
|
||||
'mobile': rel.user.mobile,
|
||||
'phone': rel.user.phone,
|
||||
'address': rel.user.address
|
||||
} for rel in user_relations]
|
||||
|
||||
return users_list
|
||||
Reference in New Issue
Block a user