Exposes the User.created attribute via API

Signed-off-by: Marcelo Moreira de Mello <tchello.mello@gmail.com>
This commit is contained in:
Marcelo Moreira de Mello
2020-07-16 17:45:07 -04:00
parent f0aec0d444
commit 3803763c53
3 changed files with 17 additions and 0 deletions

View File

@@ -127,9 +127,15 @@ def user_get_auditor_of_organizations(user):
return Organization.objects.filter(auditor_role__members=user)
@property
def created(user):
return user.date_joined
User.add_to_class('organizations', user_get_organizations)
User.add_to_class('admin_of_organizations', user_get_admin_of_organizations)
User.add_to_class('auditor_of_organizations', user_get_auditor_of_organizations)
User.add_to_class('created', created)
@property