-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
86 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -101,7 +101,7 @@ def uk_staff_location(): | |
) | ||
|
||
|
||
@pytest.fixture(autouse=True, scope="function") | ||
@pytest.fixture(scope="function") | ||
def manager_user(): | ||
return User.objects.create_user( | ||
sso_email_id="[email protected]", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
from dataclasses import dataclass | ||
from typing import Optional | ||
|
||
from ninja import Schema | ||
|
||
from profiles.models import PeopleFinderProfile | ||
|
||
|
||
@dataclass | ||
class Email: | ||
value: str | ||
type: str | None = None | ||
primary: bool = False | ||
|
||
|
||
class MinimalPeopleFinderProfile(Schema): | ||
# Basic Profile info | ||
slug: str | ||
first_name: str | ||
last_name: str | ||
sso_email_id: str | ||
preferred_first_name: Optional[str] | ||
pronouns: Optional[str] | ||
name_pronunciation: Optional[str] | ||
email: Optional[str] | ||
contact_email: Optional[str] | ||
primary_phone_number: Optional[str] | ||
secondary_phone_number: Optional[str] | ||
photo: Optional[str] # ImageField is represented as a string (file path or URL) | ||
photo_small: Optional[ | ||
str | ||
] # ImageField is represented as a string (file path or URL) | ||
grade: Optional[str] | ||
|
||
@staticmethod | ||
def resolve_slug(obj: PeopleFinderProfile): | ||
return str(obj.slug) | ||
|
||
@staticmethod | ||
def resolve_sso_email_id(obj: PeopleFinderProfile): | ||
return obj.user.sso_email_id | ||
|
||
@staticmethod | ||
def resolve_email(obj: PeopleFinderProfile): | ||
return obj.email.address | ||
|
||
@staticmethod | ||
def resolve_contact_email(obj: PeopleFinderProfile): | ||
return obj.contact_email.address |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters