crons angepasst

This commit is contained in:
Holger Trampe 2021-10-23 20:29:44 +02:00
parent 7692002047
commit 6760291078
2 changed files with 8 additions and 4 deletions

View File

@ -471,7 +471,7 @@ def statisticCronJob(request, code):
# FILES # FILES
''' '''
TODO: Hier bitte einmal checken, ob umbenannte Dateien auch gefunden werden können oder nicht TODO: Hier bitte einmal checken, ob umbenannte Dateien auch gefunden werden können oder nicht
'''
allfiles = 0 allfiles = 0
try: try:
files_data = DataFile.objects.all() files_data = DataFile.objects.all()
@ -482,6 +482,7 @@ def statisticCronJob(request, code):
allfiles_storage += os.stat(f.file.path).st_size allfiles_storage += os.stat(f.file.path).st_size
except: except:
pass pass
'''
# LOGINS YESTERDAY # LOGINS YESTERDAY
yesterday = today - timedelta(days=1) yesterday = today - timedelta(days=1)
@ -526,7 +527,7 @@ def statisticCronJob(request, code):
extrausercount += len(user_ag) - 3 extrausercount += len(user_ag) - 3
finalmrr = abos + 3*extrausercount 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() newMainS.save()
data.update({"status" : "success"}) data.update({"status" : "success"})
else: else:

View File

@ -1639,7 +1639,9 @@ def cronactions(request, code):
news.agnotify = True news.agnotify = True
news.save() news.save()
for user in allusers: for user in allusers:
pass
# SEMI-SIGNAL FOR NEWS GOING ONLINE # SEMI-SIGNAL FOR NEWS GOING ONLINE
'''
if(user.usernotifications.news_created_mail and news.agency == user.profile.agency): if(user.usernotifications.news_created_mail and news.agency == user.profile.agency):
notificationtext = "Neue Agenturnews: " + news.name notificationtext = "Neue Agenturnews: " + news.name
username = user.first_name + " " + user.last_name username = user.first_name + " " + user.last_name
@ -1659,7 +1661,7 @@ def cronactions(request, code):
channel_layer = channels.layers.get_channel_layer() 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}) async_to_sync(channel_layer.group_send)("user_" + str(user.pk), {'type' : 'pushhandler', 'pushtext' : "pushnotification__News | Neue Agenturnews: " + news.name})
'''
# LEXOFFICE TEST # LEXOFFICE TEST
# HEADERS CURL # HEADERS CURL
''' '''
@ -1855,13 +1857,14 @@ def cronactionsdaily(request, code):
for r in repre_absence: for r in repre_absence:
if(r.representator.usernotifications.absence_user_is_rep_reminder_mail): 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) 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): if(r.representator.usernotifications.absence_user_is_rep_reminder_push):
newnotification = UserNotification(touser=user, notificationtext="Erinnerung für Abwesenheitsvertretung!", notificationtype="", elementid=r.pk) newnotification = UserNotification(touser=user, notificationtext="Erinnerung für Abwesenheitsvertretung!", notificationtype="", elementid=r.pk)
newnotification.save() newnotification.save()
channel_layer = channels.layers.get_channel_layer() 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 + "!"}) 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: except:
mailstatus += "ERROR REMINDER ABSENCEMAIL" mailstatus += "ERROR REMINDER ABSENCEMAIL"