-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added a more detailed error in case the user has a wrong json structure * hr pt acquisition job (#295) * hr pt acquisition job * works * type comparisons have failed for some reason * upd PyYAML to 6.0.1 per https://stackoverflow.com/a/76710304 * fix * Checking if the web site is accessible at all * Added an empty paragraph * Removed whitespace * Update site_health_check_job.py * fix: rm legacy workflow * feat: set up adding manager by @ (#303) feat: set up adding manager by @ * feat: add get_managers handler (#302) feat: add get_managers handler * feat: add fetching all team members (#304) --------- Co-authored-by: Alex Kulikov <7394728+alexeyqu@users.noreply.github.com> Co-authored-by: Alexey Kulikov <alexeyqu@gmail.com> Co-authored-by: gisly <gisly@mail.ru> Co-authored-by: River <79055927+riveriswild@users.noreply.github.com> Co-authored-by: ovrsun <115068324+ovrsun@users.noreply.github.com>
- Loading branch information
1 parent
90fb7fb
commit 50a0437
Showing
10 changed files
with
81 additions
and
144 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import logging | ||
from typing import Callable | ||
|
||
from ..app_context import AppContext | ||
from ..strings import load | ||
from .base_job import BaseJob | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
class DBFetchAllTeamMembersJob(BaseJob): | ||
@staticmethod | ||
def _execute( | ||
app_context: AppContext, send: Callable[[str], None], called_from_handler=False | ||
): | ||
num_authors = app_context.db_client.fetch_authors_sheet( | ||
app_context.sheets_client | ||
) | ||
logger.info(f"Fetched {num_authors} authors") | ||
send(load("db_fetch_authors_sheet_job__success", num_authors=num_authors)) | ||
|
||
num_curators = app_context.db_client.fetch_curators_sheet( | ||
app_context.sheets_client | ||
) | ||
logger.info(f"Fetched {num_curators} curators") | ||
send(load("db_fetch_curators_sheet_job__success", num_curators=num_curators)) | ||
|
||
team_size = app_context.db_client.fetch_team_sheet( | ||
app_context.sheets_client | ||
) | ||
# after we fetch the team, we need to recalculate the roles | ||
app_context.role_manager.calculate_db_roles() | ||
logger.info(f"Fetched {team_size} team members") | ||
send(load("db_fetch_team_sheet_job__success", team_size=team_size)) |
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
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,10 @@ | ||
from ... import consts | ||
from ...config_manager import ConfigManager | ||
from .utils import admin_only, reply | ||
|
||
|
||
@admin_only | ||
def get_managers(update, tg_context): | ||
config_manager = ConfigManager() | ||
manager_ids = config_manager.get_telegram_config()[consts.TELEGRAM_MANAGER_IDS][:] | ||
reply(str(manager_ids), update) |