wbhuman_resources 1.55.9__tar.gz → 1.55.10rc0__tar.gz

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.
Files changed (110) hide show
  1. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/PKG-INFO +1 -1
  2. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/models/calendars.py +4 -4
  3. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/models/employee.py +5 -2
  4. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/models/kpi.py +5 -1
  5. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/models/review.py +4 -1
  6. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/tasks.py +1 -1
  7. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/utils.py +4 -1
  8. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/viewsets/absence.py +6 -6
  9. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/viewsets/buttons/kpis.py +3 -3
  10. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/viewsets/buttons/review.py +3 -3
  11. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/viewsets/display/review.py +5 -5
  12. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/.gitignore +0 -0
  13. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/pyproject.toml +0 -0
  14. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/__init__.py +0 -0
  15. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/admin/__init__.py +0 -0
  16. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/admin/absence.py +0 -0
  17. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/admin/calendars.py +0 -0
  18. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/admin/employee.py +0 -0
  19. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/admin/kpi.py +0 -0
  20. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/admin/review.py +0 -0
  21. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/apps.py +0 -0
  22. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/dynamic_preferences_registry.py +0 -0
  23. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/factories/__init__.py +0 -0
  24. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/factories/absence.py +0 -0
  25. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/factories/calendars.py +0 -0
  26. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/factories/employee.py +0 -0
  27. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/factories/kpi.py +0 -0
  28. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/filters/__init__.py +0 -0
  29. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/filters/absence.py +0 -0
  30. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/filters/absence_graphs.py +0 -0
  31. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/filters/calendars.py +0 -0
  32. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/filters/employee.py +0 -0
  33. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/filters/kpi.py +0 -0
  34. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/filters/review.py +0 -0
  35. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/filters/signals.py +0 -0
  36. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/locale/de/LC_MESSAGES/django.mo +0 -0
  37. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/locale/de/LC_MESSAGES/django.po +0 -0
  38. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/locale/de/LC_MESSAGES/django.po.translated +0 -0
  39. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/locale/en/LC_MESSAGES/django.mo +0 -0
  40. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/locale/en/LC_MESSAGES/django.po +0 -0
  41. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/locale/fr/LC_MESSAGES/django.mo +0 -0
  42. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/locale/fr/LC_MESSAGES/django.po +0 -0
  43. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/management/__init__.py +0 -0
  44. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/migrations/0001_initial_squashed_squashed_0015_alter_absencerequest_calendaritem_ptr_and_more.py +0 -0
  45. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/migrations/0016_alter_employeehumanresource_options.py +0 -0
  46. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/migrations/0017_absencerequest_crossborder_country_and_more.py +0 -0
  47. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/migrations/0018_remove_position_group_position_groups.py +0 -0
  48. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/migrations/0019_alter_absencerequest_options_alter_kpi_options_and_more.py +0 -0
  49. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/migrations/0020_alter_employeeyearbalance_year_alter_review_year.py +0 -0
  50. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/migrations/0021_alter_position_color.py +0 -0
  51. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/migrations/0022_remove_review_editable_mode.py +0 -0
  52. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/migrations/__init__.py +0 -0
  53. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/models/__init__.py +0 -0
  54. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/models/absence.py +0 -0
  55. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/models/preferences.py +0 -0
  56. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/permissions/__init__.py +0 -0
  57. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/permissions/backend.py +0 -0
  58. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/serializers/__init__.py +0 -0
  59. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/serializers/absence.py +0 -0
  60. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/serializers/calendars.py +0 -0
  61. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/serializers/employee.py +0 -0
  62. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/serializers/kpi.py +0 -0
  63. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/serializers/review.py +0 -0
  64. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/templates/review/review_report.html +0 -0
  65. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/tests/__init__.py +0 -0
  66. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/tests/conftest.py +0 -0
  67. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/tests/models/__init__.py +0 -0
  68. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/tests/models/test_absences.py +0 -0
  69. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/tests/models/test_calendars.py +0 -0
  70. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/tests/models/test_employees.py +0 -0
  71. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/tests/models/test_review.py +0 -0
  72. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/tests/models/test_utils.py +0 -0
  73. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/tests/signals.py +0 -0
  74. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/tests/test_permission.py +0 -0
  75. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/tests/test_tasks.py +0 -0
  76. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/urls.py +0 -0
  77. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/viewsets/__init__.py +0 -0
  78. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/viewsets/absence_charts.py +0 -0
  79. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/viewsets/buttons/__init__.py +0 -0
  80. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/viewsets/buttons/absence.py +0 -0
  81. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/viewsets/buttons/employee.py +0 -0
  82. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/viewsets/calendars.py +0 -0
  83. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/viewsets/display/__init__.py +0 -0
  84. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/viewsets/display/absence.py +0 -0
  85. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/viewsets/display/calendars.py +0 -0
  86. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/viewsets/display/employee.py +0 -0
  87. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/viewsets/display/kpis.py +0 -0
  88. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/viewsets/employee.py +0 -0
  89. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/viewsets/endpoints/__init__.py +0 -0
  90. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/viewsets/endpoints/absence.py +0 -0
  91. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/viewsets/endpoints/calendars.py +0 -0
  92. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/viewsets/endpoints/employee.py +0 -0
  93. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/viewsets/endpoints/kpis.py +0 -0
  94. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/viewsets/endpoints/review.py +0 -0
  95. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/viewsets/kpi.py +0 -0
  96. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/viewsets/menu/__init__.py +0 -0
  97. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/viewsets/menu/absence.py +0 -0
  98. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/viewsets/menu/administration.py +0 -0
  99. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/viewsets/menu/calendars.py +0 -0
  100. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/viewsets/menu/employee.py +0 -0
  101. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/viewsets/menu/kpis.py +0 -0
  102. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/viewsets/menu/review.py +0 -0
  103. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/viewsets/mixins.py +0 -0
  104. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/viewsets/review.py +0 -0
  105. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/viewsets/titles/__init__.py +0 -0
  106. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/viewsets/titles/absence.py +0 -0
  107. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/viewsets/titles/employee.py +0 -0
  108. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/viewsets/titles/kpis.py +0 -0
  109. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/viewsets/titles/review.py +0 -0
  110. {wbhuman_resources-1.55.9 → wbhuman_resources-1.55.10rc0}/wbhuman_resources/viewsets/utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: wbhuman_resources
3
- Version: 1.55.9
3
+ Version: 1.55.10rc0
4
4
  Summary: A workbench module for managing human resources.
5
5
  Author-email: Christopher Wittlinger <c.wittlinger@stainly.com>
6
6
  Requires-Dist: wbcore
@@ -76,10 +76,10 @@ class DayOffCalendar(WBModel):
76
76
  DayOff.objects.get_or_create(
77
77
  date=holiday_date, calendar=self, defaults={"count_as_holiday": True, "title": holiday_title}
78
78
  )
79
- except ModuleNotFoundError:
80
- raise InvalidDayOffCalendarResourceError(_("The continent you've supplied is invalid."))
81
- except AttributeError:
82
- raise InvalidDayOffCalendarResourceError(_("The region you've supplied is invalid."))
79
+ except ModuleNotFoundError as e:
80
+ raise InvalidDayOffCalendarResourceError(_("The continent you've supplied is invalid.")) from e
81
+ except AttributeError as e:
82
+ raise InvalidDayOffCalendarResourceError(_("The region you've supplied is invalid.")) from e
83
83
 
84
84
  def get_day_off_per_employee_df(self, start: date, end: date, employees) -> pd.DataFrame:
85
85
  """
@@ -830,8 +830,11 @@ class BalanceHourlyAllowance(models.Model):
830
830
  models.Index(fields=["balance", "period_index"]),
831
831
  ]
832
832
 
833
+ def __str__(self) -> str:
834
+ return f"{self.balance} - {self.period_index} Period Index: {self.hourly_allowance}"
835
+
833
836
 
834
- class EmployeeYearBalance(ComplexToStringMixin, models.Model):
837
+ class EmployeeYearBalance(ComplexToStringMixin):
835
838
  employee = models.ForeignKey(
836
839
  EmployeeHumanResource,
837
840
  related_name="balances",
@@ -935,7 +938,7 @@ class EmployeeYearBalance(ComplexToStringMixin, models.Model):
935
938
  return "wbhuman_resources:employeeyearbalancerepresentation-list"
936
939
 
937
940
 
938
- class EmployeeWeeklyOffPeriods(ComplexToStringMixin, models.Model):
941
+ class EmployeeWeeklyOffPeriods(ComplexToStringMixin):
939
942
  employee = models.ForeignKey(
940
943
  "wbhuman_resources.EmployeeHumanResource",
941
944
  related_name="default_periods_relationships",
@@ -82,7 +82,8 @@ class KPI(WBModel):
82
82
 
83
83
  @staticmethod
84
84
  def get_all_handlers() -> Iterator[KPIHandler]:
85
- for handler_path, name in settings.KPI_HANDLERS:
85
+ for param in settings.KPI_HANDLERS:
86
+ handler_path = param[0]
86
87
  *module, handler = handler_path.split(".")
87
88
  module_path = ".".join(module)
88
89
  yield getattr(importlib.import_module(module_path), handler)()
@@ -177,6 +178,9 @@ class Evaluation(models.Model):
177
178
  verbose_name = _("Evaluation")
178
179
  verbose_name_plural = _("Evaluations")
179
180
 
181
+ def __str__(self) -> str:
182
+ return f"{self.kpi} - {self.evaluation_date}"
183
+
180
184
  def get_rating(self):
181
185
  list_date = list(
182
186
  pd.date_range(
@@ -105,7 +105,7 @@ class Review(CloneMixin, ComplexToStringMixin, WBModel):
105
105
  WBColor.GREEN_LIGHT.value,
106
106
  WBColor.GREEN_DARK.value,
107
107
  ]
108
- return [choice for choice in zip(cls, colors)]
108
+ return [choice for choice in zip(cls, colors, strict=False)]
109
109
 
110
110
  class Type(models.TextChoices):
111
111
  ANNUAL = "ANNUAL", _("Annual")
@@ -721,6 +721,9 @@ class ReviewAnswer(models.Model):
721
721
  )
722
722
  answer_text = models.TextField(null=True, blank=True, verbose_name=_("Comment"))
723
723
 
724
+ def __str__(self) -> str:
725
+ return f"{self.question} - {self.answered_by}"
726
+
724
727
  @classmethod
725
728
  def get_endpoint_basename(cls):
726
729
  return "wbhuman_resources:reviewanswer"
@@ -173,7 +173,7 @@ def daily_automatic_application_deadline():
173
173
 
174
174
 
175
175
  @shared_task
176
- def periodic_updating_kpi_task(kpi_id=[], start=None, end=None):
176
+ def periodic_updating_kpi_task(kpi_id: list | None = None, start=None, end=None):
177
177
  intervals = {elt.name: KPI.Interval.get_frequence_correspondance(elt.name) for elt in KPI.Interval}
178
178
  for key, value in intervals.items():
179
179
  kpis = (
@@ -6,8 +6,11 @@ from django.utils import timezone
6
6
 
7
7
 
8
8
  def get_number_of_hours_between_dates(
9
- d1, d2, list_employee_dayoffs, list_public_holidays=False, hours_range=range(0, 23), granularity=12
9
+ d1, d2, list_employee_dayoffs, list_public_holidays=False, hours_range=None, granularity=12
10
10
  ):
11
+ if hours_range is None:
12
+ hours_range = range(0, 23)
13
+
11
14
  def convert_days_from_hours(hours, granularity, hours_per_day):
12
15
  return int(hours / granularity) * granularity / hours_per_day
13
16
 
@@ -5,7 +5,7 @@ from django.db.models.functions import Concat, Extract
5
5
  from django.shortcuts import get_object_or_404
6
6
  from django.utils import timezone
7
7
  from django.utils.functional import cached_property
8
- from django.utils.translation import gettext as _
8
+ from django.utils.translation import gettext
9
9
  from rest_framework import filters
10
10
  from rest_framework.decorators import action
11
11
  from rest_framework.response import Response
@@ -143,7 +143,7 @@ class AbsenceRequestModelViewSet(EmployeeViewMixin, viewsets.ModelViewSet):
143
143
  ).exclude(id=instance.id)
144
144
  activities_title = qs.values_list("title", flat=True)
145
145
  if len(activities_title) > 0:
146
- message = _("<p>During this absence, you already have these events:</p><ul>")
146
+ message = gettext("<p>During this absence, you already have these events:</p><ul>")
147
147
  for activity_title in activities_title:
148
148
  message += f"<li>{activity_title}</li>"
149
149
  message += "</ul>"
@@ -169,11 +169,11 @@ class AbsenceRequestModelViewSet(EmployeeViewMixin, viewsets.ModelViewSet):
169
169
  available_hourly_balance_in_days = (
170
170
  available_hourly_balance / instance.employee.calendar.get_daily_hours()
171
171
  )
172
- message = _(
172
+ message = gettext(
173
173
  "After this request, you will have {} days ({} hours) left for the balance {}</b>"
174
174
  ).format(available_hourly_balance_in_days, available_hourly_balance, current_balance.year)
175
175
  if other_pending_hours > 0:
176
- message += _(
176
+ message += gettext(
177
177
  " (not including <b>{pending_hours}</b> hours from other pending/draft absence requests)"
178
178
  ).format(pending_hours=other_pending_hours)
179
179
  if available_hourly_balance < 0:
@@ -185,7 +185,7 @@ class AbsenceRequestModelViewSet(EmployeeViewMixin, viewsets.ModelViewSet):
185
185
  )
186
186
  if day_offs:
187
187
  day_offs_messages = [
188
- _("{holiday} not counted ({title})").format(
188
+ gettext("{holiday} not counted ({title})").format(
189
189
  holiday=holiday.date.strftime("%d.%m.%Y"), title=holiday.title
190
190
  )
191
191
  for holiday in day_offs
@@ -236,7 +236,7 @@ class AbsenceRequestModelViewSet(EmployeeViewMixin, viewsets.ModelViewSet):
236
236
  def increaseday(self, request, pk=None):
237
237
  absence_request = get_object_or_404(AbsenceRequest, id=pk)
238
238
  if absence_request.type.is_extensible and (number_days := int(request.POST.get("number_days", 1))):
239
- for i in range(number_days):
239
+ for _ in range(number_days):
240
240
  if next_extensible_period := absence_request.next_extensible_period:
241
241
  absence_request.period = next_extensible_period
242
242
  absence_request.save()
@@ -5,12 +5,12 @@ from wbcore.metadata.configs import buttons as bt
5
5
 
6
6
  class KPIButtonConfig(bt.ButtonViewConfig):
7
7
  def get_custom_instance_buttons(self):
8
- BUTTONS = []
8
+ buttons = []
9
9
  if self.view.kwargs.get("pk", None):
10
- BUTTONS += [
10
+ buttons += [
11
11
  bt.WidgetButton(
12
12
  key="evaluationgraph", label=_("Evaluation Graph"), icon=WBIcon.CHART_BARS_HORIZONTAL.icon
13
13
  ),
14
14
  bt.WidgetButton(key="kpievaluationpandas", label=_("Latest Evaluations"), icon=WBIcon.DATA_GRID.icon),
15
15
  ]
16
- return {*BUTTONS}
16
+ return {*buttons}
@@ -32,7 +32,7 @@ class ReviewButtonConfig(bt.ButtonViewConfig):
32
32
  return self.get_custom_instance_buttons()
33
33
 
34
34
  def get_custom_instance_buttons(self):
35
- BUTTONS = [
35
+ buttons = [
36
36
  bt.WidgetButton(key="progress", label=_("Progress"), icon=WBIcon.CHART_BARS_HORIZONTAL.icon),
37
37
  bt.ActionButton(
38
38
  method=RequestType.PATCH,
@@ -132,7 +132,7 @@ class ReviewButtonConfig(bt.ButtonViewConfig):
132
132
  "include_kpi",
133
133
  )
134
134
 
135
- BUTTONS.append(
135
+ buttons.append(
136
136
  bt.ActionButton(
137
137
  method=RequestType.PATCH,
138
138
  identifiers=("wbhuman_resources:review",),
@@ -158,7 +158,7 @@ class ReviewButtonConfig(bt.ButtonViewConfig):
158
158
  ),
159
159
  )
160
160
  )
161
- return {*BUTTONS}
161
+ return {*buttons}
162
162
 
163
163
 
164
164
  class ReviewGroupButtonConfig(bt.ButtonViewConfig):
@@ -303,24 +303,24 @@ class ReviewQuestionReviewDisplayConfig(ReviewQuestionDisplayConfig):
303
303
 
304
304
  class ReviewAnswerDisplayConfig(DisplayViewConfig):
305
305
  def get_list_display(self) -> Optional[dp.ListDisplay]:
306
- FIELDS = [
306
+ fields = [
307
307
  dp.Field(key="question_name", label=_("Question"), width=Unit.PIXEL(720)),
308
308
  dp.Field(key="mandatory", label=_("Mandatory"), width=Unit.PIXEL(80)),
309
309
  ]
310
310
  if self.view.get_queryset().filter(question__answer_type=ReviewQuestion.ANSWERTYPE.RATING):
311
- FIELDS += [dp.Field(key="answer_number", label=_("Rating"), width=Unit.PIXEL(170))]
311
+ fields += [dp.Field(key="answer_number", label=_("Rating"), width=Unit.PIXEL(170))]
312
312
 
313
- FIELDS += [dp.Field(key="answer_text", label=_("Comment"), width=Unit.PIXEL(720))]
313
+ fields += [dp.Field(key="answer_text", label=_("Comment"), width=Unit.PIXEL(720))]
314
314
 
315
315
  if review_id := self.view.kwargs.get("review_id"):
316
316
  review = Review.objects.get(id=review_id)
317
317
  if review.status in [Review.Status.EVALUATION, Review.Status.VALIDATION]:
318
- FIELDS = [
318
+ fields = [
319
319
  dp.Field(key="question_name", label=_("Question"), width=Unit.PIXEL(740)),
320
320
  dp.Field(key="answered_by", label=_("Answered By"), width=Unit.PIXEL(140)),
321
321
  dp.Field(key="answer_text", label=_("Comment"), width=Unit.PIXEL(740)),
322
322
  ]
323
- return dp.ListDisplay(fields=FIELDS)
323
+ return dp.ListDisplay(fields=fields)
324
324
 
325
325
  def get_instance_display(self) -> Display:
326
326
  grid_fields = [[repeat_field(2, "question_name")], ["mandatory", "."]]