-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from ElemarJR/planned_vs_actual
Planned vs actual
- Loading branch information
Showing
18 changed files
with
1,006 additions
and
344 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 |
---|---|---|
|
@@ -11,6 +11,7 @@ downloads/ | |
eggs/ | ||
.eggs/ | ||
lib/ | ||
!frontend/src/lib | ||
lib64/ | ||
parts/ | ||
sdist/ | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,33 @@ | ||
from models.domain import WorkerKind | ||
import globals | ||
|
||
def resolve_user(_, info, email=None): | ||
if email is not None: | ||
return globals.omni_models.workers.get_by_email(email) | ||
else: | ||
def resolve_user(_, info, email=None, slug=None): | ||
if not email and not slug: | ||
return None | ||
|
||
|
||
worker = None | ||
if email: | ||
worker = globals.omni_models.workers.get_by_email(email) | ||
elif slug: | ||
worker = globals.omni_models.workers.get_by_slug(slug) | ||
|
||
if not worker: | ||
return None | ||
|
||
result = { | ||
"id": worker.id, | ||
"name": worker.name, | ||
"email": worker.email, | ||
"slug": worker.slug, | ||
"kind": worker.kind, | ||
"position": worker.position, | ||
"photo_url": worker.photo_url, | ||
# Add other attributes as needed | ||
} | ||
kind_map = { | ||
WorkerKind.ACCOUNT_MANAGER: "ACCOUNT_MANAGER", | ||
WorkerKind.CONSULTANT: "CONSULTANT" | ||
} | ||
result["kind"] = kind_map.get(result["kind"], result["kind"]) | ||
|
||
return result |
Oops, something went wrong.