Skip to content

Commit

Permalink
Add 'is_admin' to MemberPrivateResponse
Browse files Browse the repository at this point in the history
  • Loading branch information
wjdp committed Jul 30, 2023
1 parent 049f9f9 commit 99bf810
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/lumina/schema/member.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ class MemberPrivateResponse(LuminaModel):
year_of_graduation: int | None
consent: MemberConsent
anonymous_ids: list[UUID] | None
is_admin: bool = False

@classmethod
def from_model(cls, model: MemberModel):
Expand All @@ -71,6 +72,7 @@ def from_model(cls, model: MemberModel):
if model.consent
else MemberConsent.get_no_consent(),
anonymous_ids=model.anonymous_ids,
is_admin=model.is_admin,
)


Expand Down
5 changes: 5 additions & 0 deletions tests/unit/lumina/endpoints/__snapshots__/test_member.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
'emailVerified': False,
'emailVerifiedAt': None,
'id': 'fred_bloggs',
'isAdmin': False,
'phone': None,
'yearOfGraduation': None,
}),
Expand All @@ -30,6 +31,7 @@
'emailVerified': False,
'emailVerifiedAt': None,
'id': 'alice_bloggs',
'isAdmin': False,
'phone': None,
'yearOfGraduation': None,
}),
Expand All @@ -49,6 +51,7 @@
'emailVerified': True,
'emailVerifiedAt': '2021-01-01T00:00:00',
'id': 'fred_bloggs',
'isAdmin': False,
'phone': None,
'yearOfGraduation': None,
})
Expand All @@ -69,6 +72,7 @@
'emailVerified': True,
'emailVerifiedAt': '2021-01-01T00:00:00',
'id': 'fred_bloggs',
'isAdmin': False,
'phone': None,
'yearOfGraduation': None,
})
Expand All @@ -87,6 +91,7 @@
'emailVerified': True,
'emailVerifiedAt': '2021-01-01T00:00:00',
'id': 'fred_bloggs',
'isAdmin': False,
'phone': None,
'yearOfGraduation': None,
})
Expand Down

0 comments on commit 99bf810

Please sign in to comment.