ositah 24.2.dev1__py3-none-any.whl → 24.7__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -55,7 +55,11 @@ def declaration_periods_layout():
55
55
 
56
56
  # Disable creation of a new (next) period if the period matching the current already exists
57
57
  today = date.today().isoformat()
58
- if today >= declaration_periods[-1].start_date and today <= declaration_periods[-1].end_date:
58
+ if (
59
+ len(declaration_periods) > 0
60
+ and today >= declaration_periods[-1].start_date
61
+ and today <= declaration_periods[-1].end_date
62
+ ):
59
63
  current_period_exists = True
60
64
  else:
61
65
  current_period_exists = False
@@ -298,7 +298,7 @@ def build_validation_table(team, team_selection_date, declaration_set: int, peri
298
298
  html.Em(
299
299
  (
300
300
  f"Temps déclarés de l'équipe / total ="
301
- f" {round(selected_declarations['percent_global'].mean(),1)}%"
301
+ f" {round(selected_declarations['percent_global'].mean(), 1)}%"
302
302
  f" (100%={SEMESTER_WEEKS} semaines)"
303
303
  )
304
304
  )
ositah/main.py CHANGED
@@ -117,7 +117,7 @@ def url_not_found(path):
117
117
  # valid role missing jumbotron
118
118
  def valid_role_missing(msg):
119
119
  return ositah_jumbotron(
120
- "You don't havea valid Hito role to OSITAH",
120
+ "You don't have a valid Hito role to OSITAH",
121
121
  msg,
122
122
  title_class="text-warning",
123
123
  )
@@ -204,9 +204,7 @@ def render_page_content(pathname, login_menu):
204
204
  if not user_session_data.agent_teams:
205
205
  if role == HITO_ROLE_TEAM_MGR:
206
206
  # For a team manager, show only the teams he/she is a manager
207
- teams = Team.query.filter(
208
- Team.managers.any(email_auth=session["user_email"])
209
- ).all()
207
+ teams = Team.query.filter(Team.managers.any(email=session["user_email"])).all()
210
208
  if len(teams) == 0:
211
209
  # A user with role ROLE_RESP but is not the manager of any team is degraded
212
210
  # to ROLE_AGENT
ositah/ositah.example.cfg CHANGED
@@ -85,7 +85,7 @@ server:
85
85
  # Options related to declarations
86
86
  declaration:
87
87
  # Default date must be a date included into the selected validation period. It is a default, if no other explicitly select
88
- default_date: 2021-07-01
88
+ #default_date: 2021-07-01
89
89
  # max_hours specifies the upper valid value for activities declared in hours
90
90
  max_hours: 400
91
91
  # Agent statut whose declaration is not mandatory
@@ -199,12 +199,16 @@ class ActiviteDetail(db.Model):
199
199
 
200
200
 
201
201
  class OSITAHSession(db.Model):
202
+ __table_args__ = {"mysql_charset": "utf8mb4", "mysql_collate": "utf8mb4_unicode_ci"}
203
+
202
204
  id = db.Column(db.String(36), primary_key=True)
203
205
  email = db.Column(db.String(255), nullable=False)
204
206
  last_use = db.Column(db.DateTime, nullable=False)
205
207
 
206
208
 
207
209
  class OSITAHValidation(db.Model):
210
+ __table_args__ = {"mysql_charset": "utf8mb4", "mysql_collate": "utf8mb4_unicode_ci"}
211
+
208
212
  id = db.Column(db.String(36), primary_key=True, default=new_uuid)
209
213
  validated = db.Column(db.Boolean, nullable=False)
210
214
  timestamp = db.Column(db.DateTime, nullable=False)
@@ -221,6 +225,8 @@ class OSITAHValidation(db.Model):
221
225
 
222
226
 
223
227
  class OSITAHValidationPeriod(db.Model):
228
+ __table_args__ = {"mysql_charset": "utf8mb4", "mysql_collate": "utf8mb4_unicode_ci"}
229
+
224
230
  id = db.Column(db.String(36), primary_key=True, default=new_uuid)
225
231
  name = db.Column(db.String(255), unique=True, nullable=False)
226
232
  start_date = db.Column(db.DateTime, nullable=False)
@@ -229,6 +235,8 @@ class OSITAHValidationPeriod(db.Model):
229
235
 
230
236
 
231
237
  class OSITAHProjectDeclaration(db.Model):
238
+ __table_args__ = {"mysql_charset": "utf8mb4", "mysql_collate": "utf8mb4_unicode_ci"}
239
+
232
240
  id = db.Column(db.String(36), primary_key=True, default=new_uuid)
233
241
  projet = db.Column(db.String(255), nullable=False)
234
242
  masterprojet = db.Column(db.String(255), nullable=False)
ositah/utils/menus.py CHANGED
@@ -324,7 +324,7 @@ def ositah_jumbotron(title: str, main_text: str, details: str = None, title_clas
324
324
  return html.Div(
325
325
  dbc.Container(
326
326
  [
327
- html.H1(title, className=f"display-3 {title_class if ( title_class ) else ''}"),
327
+ html.H1(title, className=f"display-3 {title_class if (title_class) else ''}"),
328
328
  html.P(
329
329
  main_text,
330
330
  className="lead",
ositah/utils/teams.py CHANGED
@@ -1,42 +1,42 @@
1
- import re
2
- from typing import Dict, List
3
-
4
- import pandas as pd
5
-
6
-
7
- def get_hito_teams():
8
- """
9
- Return Hito teams as a Dataframe
10
-
11
- :return: Hito teams
12
- """
13
-
14
- from .hito_db import Team, db
15
-
16
- team_query = Team.query
17
-
18
- teams = pd.read_sql(team_query.statement, con=db.session.bind)
19
-
20
- return teams
21
-
22
-
23
- def get_project_team_ids(team_config: Dict[str, str], project: str) -> List[str]:
24
- """
25
- Return the list of team ID associated with the project based on the configuration passed.
26
- The configuration is a dict where the key is a pattern applied to the project name and
27
- the value is the list of team names.
28
-
29
- :param team_config: dict describing the teams associated with a project
30
- :param project: project name
31
- :return: list of team ids or None if no match is found
32
- """
33
-
34
- for pattern, team_list in team_config.items():
35
- if re.match(pattern, project):
36
- hito_teams = get_hito_teams()
37
- hito_teams["selected"] = False
38
- for team_pattern in team_list:
39
- hito_teams.loc[hito_teams.nom.str.match(f"{team_pattern}$"), "selected"] = True
40
- return hito_teams["id"].to_list()
41
-
42
- return None
1
+ import re
2
+ from typing import Dict, List
3
+
4
+ import pandas as pd
5
+
6
+
7
+ def get_hito_teams():
8
+ """
9
+ Return Hito teams as a Dataframe
10
+
11
+ :return: Hito teams
12
+ """
13
+
14
+ from .hito_db_model import Team, db
15
+
16
+ team_query = Team.query
17
+
18
+ teams = pd.read_sql(team_query.statement, con=db.session.bind)
19
+
20
+ return teams
21
+
22
+
23
+ def get_project_team_ids(team_config: Dict[str, str], project: str) -> List[str]:
24
+ """
25
+ Return the list of team ID associated with the project based on the configuration passed.
26
+ The configuration is a dict where the key is a pattern applied to the project name and
27
+ the value is the list of team names.
28
+
29
+ :param team_config: dict describing the teams associated with a project
30
+ :param project: project name
31
+ :return: list of team ids or None if no match is found
32
+ """
33
+
34
+ for pattern, team_list in team_config.items():
35
+ if re.match(pattern, project):
36
+ hito_teams = get_hito_teams()
37
+ hito_teams["selected"] = False
38
+ for team_pattern in team_list:
39
+ hito_teams.loc[hito_teams.nom.str.match(f"{team_pattern}$"), "selected"] = True
40
+ return hito_teams["id"].to_list()
41
+
42
+ return None
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ositah
3
- Version: 24.2.dev1
3
+ Version: 24.7
4
4
  Summary: Outils de Suivi d'Activités basé sur Hito
5
5
  Author-email: Michel Jouvin <michel.jouvin@ijclab.in2p3.fr>
6
6
  License: BSD 3-Clause License
@@ -1,20 +1,20 @@
1
1
  ositah/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
2
  ositah/app.py,sha256=53ylXmqBSo31omZt-XBPBhOzlkGQBuDenU0Q8m7efCg,428
3
- ositah/main.py,sha256=k6Iv_5a9swWgcmT4g_pObu9Yh3Nu20iPYiG0sfFA6aU,15725
4
- ositah/ositah.example.cfg,sha256=dwmTDeclGDsPNfx_892CBJEfN7QoA0E3mXmCGJzHiPg,7471
3
+ ositah/main.py,sha256=vw8PBYP3ugtWKWUta3UKagh8lbp-ogl8LUNF-KSyo0s,15673
4
+ ositah/ositah.example.cfg,sha256=-k6Bytmuml3KHQn_1gGxW2k2bBAc39zPN6Ew5rG14xw,7472
5
5
  ositah/apps/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
6
  ositah/apps/analysis.py,sha256=8bmP5m4nmfMODu1_YpzqCiFR2U2TMOOxAHbujY8od8g,28259
7
7
  ositah/apps/export.py,sha256=4h9_nk9uKopwfxgzqKyFk5u4qVQ9mtgGvk3zmxbhTV0,47532
8
8
  ositah/apps/configuration/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
9
  ositah/apps/configuration/callbacks.py,sha256=J1bWwxQF2JRX6vvkTF22XXr4R2HEEXyK3ht75hbFgAM,33477
10
- ositah/apps/configuration/main.py,sha256=K0pQePovp88r5RRJiBwXi7RNK2P7S6iTN1a-TUYUU6I,20299
10
+ ositah/apps/configuration/main.py,sha256=Kc0HU74bq2vV5RY5izYWlYAkkVfNyB2MxC20XquLDCc,20368
11
11
  ositah/apps/configuration/parameters.py,sha256=KmEVdC--IJRC3yzCN97FY1SooOKFy3bMneFBo1sGa54,3862
12
12
  ositah/apps/configuration/tools.py,sha256=e4CYt3F_2NY34vILwxHBWtvFntq082gwpKNsZZVexHE,3982
13
13
  ositah/apps/validation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
14
14
  ositah/apps/validation/callbacks.py,sha256=N9j0HLe8Xp1zZUrVgx0woeDBwVtJLQZ_BPVNaJ9UIZo,9557
15
15
  ositah/apps/validation/main.py,sha256=en9D6c65DUosbU31dxLR6BhLCU3yj7uxyoS3MYzvw30,2896
16
16
  ositah/apps/validation/parameters.py,sha256=tDHqDnoWv1QhcTad2yhqLT9_wCpj8sTYxKWsi1UF-uk,1003
17
- ositah/apps/validation/tables.py,sha256=Zz-yJw6Bw2fQOa87PW4EmW3nQZmmZF1kqr11NfWvQOI,24770
17
+ ositah/apps/validation/tables.py,sha256=7NL4tvZ9zF1LwJ2YHJGrSvw2NqzhyK7OCLscchBfKNM,24771
18
18
  ositah/apps/validation/tools.py,sha256=omz6M10cCI5A8aTWllpkqFDEcIQFEhjzxOCiJKhHuDc,18046
19
19
  ositah/assets/arrow_down_up.svg,sha256=jH7QOmbLkYnNENa2PlBktOYHKDGN5KbrrFcV6UpgkCY,503
20
20
  ositah/assets/ositah.css,sha256=_T3mwonAYMPoDJoHYgJ5XgdFllHMcE28vnMMDd_hdOQ,1094
@@ -32,15 +32,15 @@ ositah/utils/cache.py,sha256=mM1iKDzQbVJZvTOgfPnvbxSBWi-OVGly6MncQ09CtEY,504
32
32
  ositah/utils/core.py,sha256=OFML9h5JNmXXeMo7n90FSBDHtivWOY7ff2SJcG4uYEM,295
33
33
  ositah/utils/exceptions.py,sha256=ZVngkr28pBxO-kZAeKW9FWAFyhzuWL98-S92mieHMSk,1911
34
34
  ositah/utils/hito_db.py,sha256=awVGrd1DAyj6BaEkLjTVN1l9A5SjZUJ1-fQ5PAik7bI,1510
35
- ositah/utils/hito_db_model.py,sha256=gtj0URvmxg0Ms7xcEXhkf84Blb3RZl4F8nWmsqrqwXk,8988
36
- ositah/utils/menus.py,sha256=Ypb4nXVBuW3eA2iIBR4T_s3N4PAKHA5_udiCSLKcgII,12007
35
+ ositah/utils/hito_db_model.py,sha256=GvCHp5u-mPQinbZPvF6ONJAWIc2no1KN_VNJv6NCaPk,9356
36
+ ositah/utils/menus.py,sha256=Xoyo2ySX0MD7phzyO5WjEcR0PCXwsX1TSrzONXnX4yI,12005
37
37
  ositah/utils/period.py,sha256=CxT77mAQasD59BmecXRUwme-_76hOr2kotOwTy6ZKfk,4058
38
38
  ositah/utils/projects.py,sha256=xLQ0RpJzMmCpx9Xdy8sHPQ-tijeWvSFPVSgOl5D6aSk,43479
39
- ositah/utils/teams.py,sha256=q8oRriecvM19whPWnIlScS2oqWIhGIdJHP0T1pK12W8,1186
39
+ ositah/utils/teams.py,sha256=K8Z6kqs-kFpNiIg6wgmmZ3_tmfUPaB7wp0OAGmmZPG4,1234
40
40
  ositah/utils/utils.py,sha256=rUp366CNWLX3GMMHcJsau_y6kp52uCs1Hels2ESatGY,16372
41
- ositah-24.2.dev1.dist-info/LICENSE,sha256=2C86YWCx1fvz92WySupcb6_t4NhHCVPE_ucy0YMTuoc,1550
42
- ositah-24.2.dev1.dist-info/METADATA,sha256=T2invjMqUgwd0KRzzYDi97qmB5MUMK3ATr9oVRqZfeA,8103
43
- ositah-24.2.dev1.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
44
- ositah-24.2.dev1.dist-info/entry_points.txt,sha256=t9oDDLUO1LwHJewlE862LbJMHpDTEyqbeUAPw_F7Q3I,44
45
- ositah-24.2.dev1.dist-info/top_level.txt,sha256=3kfj_oK4xoZFt0nsw6KKT_aoqshELBu0ryLXECbcqNI,7
46
- ositah-24.2.dev1.dist-info/RECORD,,
41
+ ositah-24.7.dist-info/LICENSE,sha256=2C86YWCx1fvz92WySupcb6_t4NhHCVPE_ucy0YMTuoc,1550
42
+ ositah-24.7.dist-info/METADATA,sha256=DbSd9LDthyUuMrSnunkOmpszD3cVkSiXJZEPRy8knY0,8098
43
+ ositah-24.7.dist-info/WHEEL,sha256=y4mX-SOX4fYIkonsAGA5N0Oy-8_gI4FXw5HNI1xqvWg,91
44
+ ositah-24.7.dist-info/entry_points.txt,sha256=t9oDDLUO1LwHJewlE862LbJMHpDTEyqbeUAPw_F7Q3I,44
45
+ ositah-24.7.dist-info/top_level.txt,sha256=3kfj_oK4xoZFt0nsw6KKT_aoqshELBu0ryLXECbcqNI,7
46
+ ositah-24.7.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.42.0)
2
+ Generator: setuptools (70.2.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5