From 67602910789771ee511bf82361355bb271ddfd6e Mon Sep 17 00:00:00 2001 From: Holger Trampe Date: Sat, 23 Oct 2021 20:29:44 +0200 Subject: [PATCH] crons angepasst --- adm/views.py | 5 +++-- users/views.py | 7 +++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/adm/views.py b/adm/views.py index 426fa66..b5f3521 100644 --- a/adm/views.py +++ b/adm/views.py @@ -471,7 +471,7 @@ def statisticCronJob(request, code): # FILES ''' TODO: Hier bitte einmal checken, ob umbenannte Dateien auch gefunden werden können oder nicht - ''' + allfiles = 0 try: files_data = DataFile.objects.all() @@ -482,6 +482,7 @@ def statisticCronJob(request, code): allfiles_storage += os.stat(f.file.path).st_size except: pass + ''' # LOGINS YESTERDAY yesterday = today - timedelta(days=1) @@ -526,7 +527,7 @@ def statisticCronJob(request, code): extrausercount += len(user_ag) - 3 finalmrr = abos + 3*extrausercount - newMainS = MainStatistic(agencys=agencycount,users=usercount,standards=standardcount,chatmessages=chatmesscount, active_abos=abocount, absenceobjects=absenceobjects, user_active_timemanagement=user_active_timemanagement, organizerobjects=organizerobjects, agency_recoverobjects=agency_recoverobjects, allfiles=allfiles, allfiles_storage=allfiles_storage, logins=logins, mrr=finalmrr) + newMainS = MainStatistic(agencys=agencycount,users=usercount,standards=standardcount,chatmessages=chatmesscount, active_abos=abocount, absenceobjects=absenceobjects, user_active_timemanagement=user_active_timemanagement, organizerobjects=organizerobjects, agency_recoverobjects=agency_recoverobjects, logins=logins, mrr=finalmrr) newMainS.save() data.update({"status" : "success"}) else: diff --git a/users/views.py b/users/views.py index 0d724c8..82f4f1c 100644 --- a/users/views.py +++ b/users/views.py @@ -1639,7 +1639,9 @@ def cronactions(request, code): news.agnotify = True news.save() for user in allusers: + pass # SEMI-SIGNAL FOR NEWS GOING ONLINE + ''' if(user.usernotifications.news_created_mail and news.agency == user.profile.agency): notificationtext = "Neue Agenturnews: " + news.name username = user.first_name + " " + user.last_name @@ -1659,7 +1661,7 @@ def cronactions(request, code): channel_layer = channels.layers.get_channel_layer() async_to_sync(channel_layer.group_send)("user_" + str(user.pk), {'type' : 'pushhandler', 'pushtext' : "pushnotification__News | Neue Agenturnews: " + news.name}) - + ''' # LEXOFFICE TEST # HEADERS CURL ''' @@ -1855,13 +1857,14 @@ def cronactionsdaily(request, code): for r in repre_absence: if(r.representator.usernotifications.absence_user_is_rep_reminder_mail): sendMailNoti(" in einer Woche startet Ihre Vertretung für " + r.user.first_name + " " + r.user.last_name + "!", user) - + ''' if(r.representator.usernotifications.absence_user_is_rep_reminder_push): newnotification = UserNotification(touser=user, notificationtext="Erinnerung für Abwesenheitsvertretung!", notificationtype="", elementid=r.pk) newnotification.save() channel_layer = channels.layers.get_channel_layer() async_to_sync(channel_layer.group_send)("user_" + str(user.pk), {'type' : 'pushhandler', 'pushtext' : "pushnotification__Abwesenheit | In einer Woche startet Ihre Vertretung für " + r.user.first_name + " " + r.user.last_name + "!"}) + ''' except: mailstatus += "ERROR REMINDER ABSENCEMAIL"