Skip to content

Commit

Permalink
changing trimester dates; fixing email of agenda to get manager only
Browse files Browse the repository at this point in the history
  • Loading branch information
Ederporto committed Oct 2, 2024
1 parent 40b6004 commit e149551
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion agenda/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ def send_email(request):

areas = TeamArea.objects.filter(team_area_of_position__type__name="Manager")
for area in areas:
manager = UserProfile.objects.filter(user__is_active=True, position__area_associated=area).first()
manager = UserProfile.objects.filter(user__is_active=True, position__area_associated=area, position__type__name="Manager").first()
manager_email = manager.user.email

if manager_email:
Expand Down
8 changes: 4 additions & 4 deletions metrics/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,9 @@ def export_trimester_report_by_by_area_responsible(request):
def get_results_divided_by_trimester(buffer, area=None):
timespan_array = [
(datetime.date(datetime.datetime.today().year, 1, 1), datetime.date(datetime.datetime.today().year, 3, 31)),
(datetime.date(datetime.datetime.today().year, 4, 1), datetime.date(datetime.datetime.today().year, 6, 30)),
(datetime.date(datetime.datetime.today().year, 7, 1), datetime.date(datetime.datetime.today().year, 9, 30)),
(datetime.date(datetime.datetime.today().year, 10, 1), datetime.date(datetime.datetime.today().year, 12, 31)),
(datetime.date(datetime.datetime.today().year, 4, 1), datetime.date(datetime.datetime.today().year, 6, 18)),
(datetime.date(datetime.datetime.today().year, 6, 19), datetime.date(datetime.datetime.today().year, 9, 20)),
(datetime.date(datetime.datetime.today().year, 9, 21), datetime.date(datetime.datetime.today().year, 12, 31)),
(datetime.date(datetime.datetime.today().year, 1, 1), datetime.date(datetime.datetime.today().year, 12, 31))
]
if area:
Expand Down Expand Up @@ -188,7 +188,7 @@ def get_results_divided_by_trimester(buffer, area=None):

def get_results_for_timespan(timespan_array, metric_query=Q(), report_query=Q()):
results = []
for metric in Metric.objects.filter(metric_query).order_by("activity_id"):
for metric in Metric.objects.filter(metric_query).order_by("activity_id", "id"):
done_row = []
refs = []
for time_ini, time_end in timespan_array:
Expand Down

0 comments on commit e149551

Please sign in to comment.