Fix register_r cookie error

This commit is contained in:
Tomasz 2021-02-05 20:12:07 +01:00
parent b031932fba
commit 1d2faef90e
14 changed files with 157 additions and 157 deletions

View file

@ -1,22 +1,22 @@
import requests
import json
def get_attendance(register_id, register_r, oun, s, date):
def get_attendance(register_id, students, oun, s, date):
cookies = s
if oun != 'http://uonetplus-uczen.fakelog.cf/powiatwulkanowy/123458':
cookies.update({
"biezacyRokSzkolny": f"{register_r['data'][0]['DziennikRokSzkolny']}",
"idBiezacyDziennik": f"{register_r['data'][0]['IdDziennik']}",
"idBiezacyDziennikPrzedszkole": f"{register_r['data'][0]['IdPrzedszkoleDziennik']}",
"idBiezacyDziennikWychowankowie": f"{register_r['data'][0]['IdWychowankowieDziennik']}",
"idBiezacyUczen": f"{register_r['data'][0]['IdUczen']}"
"biezacyRokSzkolny": f"{students['data'][0]['DziennikRokSzkolny']}",
"idBiezacyDziennik": f"{students['data'][0]['IdDziennik']}",
"idBiezacyDziennikPrzedszkole": f"{students['data'][0]['IdPrzedszkoleDziennik']}",
"idBiezacyDziennikWychowankowie": f"{students['data'][0]['IdWychowankowieDziennik']}",
"idBiezacyUczen": f"{students['data'][0]['IdUczen']}"
})
else:
cookies.update({
"biezacyRokSzkolny": f"{register_r['data'][0]['DziennikRokSzkolny']}",
"idBiezacyDziennik": f"{register_r['data'][0]['IdDziennik']}",
"idBiezacyDziennikPrzedszkole": f"{register_r['data'][0]['IdPrzedszkoleDziennik']}",
"idBiezacyUczen": f"{register_r['data'][0]['IdUczen']}"
"biezacyRokSzkolny": f"{students['data'][0]['DziennikRokSzkolny']}",
"idBiezacyDziennik": f"{students['data'][0]['IdDziennik']}",
"idBiezacyDziennikPrzedszkole": f"{students['data'][0]['IdPrzedszkoleDziennik']}",
"idBiezacyUczen": f"{students['data'][0]['IdUczen']}"
})
headers = {

View file

@ -3,23 +3,23 @@ import requests
import re
from bs4 import BeautifulSoup
def get_dashboard(register_id, register_r, s, diary_url, symbol):
def get_dashboard(register_id, students, s, diary_url, symbol):
cookies = s
if diary_url != 'http://cufs.fakelog.cf/':
cookies.update({
"biezacyRokSzkolny": f"{register_r['data'][0]['DziennikRokSzkolny']}",
"idBiezacyDziennik": f"{register_r['data'][0]['IdDziennik']}",
"idBiezacyDziennikPrzedszkole": f"{register_r['data'][0]['IdPrzedszkoleDziennik']}",
"idBiezacyDziennikWychowankowie": f"{register_r['data'][0]['IdWychowankowieDziennik']}",
"idBiezacyUczen": f"{register_r['data'][0]['IdUczen']}"
"biezacyRokSzkolny": f"{students['data'][0]['DziennikRokSzkolny']}",
"idBiezacyDziennik": f"{students['data'][0]['IdDziennik']}",
"idBiezacyDziennikPrzedszkole": f"{students['data'][0]['IdPrzedszkoleDziennik']}",
"idBiezacyDziennikWychowankowie": f"{students['data'][0]['IdWychowankowieDziennik']}",
"idBiezacyUczen": f"{students['data'][0]['IdUczen']}"
})
diary_url = 'http://uonetplus.vulcan.net.pl/'
else:
cookies.update({
"biezacyRokSzkolny": f"{register_r['data'][0]['DziennikRokSzkolny']}",
"idBiezacyDziennik": f"{register_r['data'][0]['IdDziennik']}",
"idBiezacyDziennikPrzedszkole": f"{register_r['data'][0]['IdPrzedszkoleDziennik']}",
"idBiezacyUczen": f"{register_r['data'][0]['IdUczen']}"
"biezacyRokSzkolny": f"{students['data'][0]['DziennikRokSzkolny']}",
"idBiezacyDziennik": f"{students['data'][0]['IdDziennik']}",
"idBiezacyDziennikPrzedszkole": f"{students['data'][0]['IdPrzedszkoleDziennik']}",
"idBiezacyUczen": f"{students['data'][0]['IdUczen']}"
})
diary_url = 'http://uonetplus.fakelog.cf/'

View file

@ -1,22 +1,22 @@
import json
import requests
def get_exams(register_id, register_r, oun, s, date, school_year):
def get_exams(register_id, students, oun, s, date, school_year):
cookies = s
if oun != 'http://uonetplus-uczen.fakelog.cf/powiatwulkanowy/123458':
cookies.update({
"biezacyRokSzkolny": f"{register_r['data'][0]['DziennikRokSzkolny']}",
"idBiezacyDziennik": f"{register_r['data'][0]['IdDziennik']}",
"idBiezacyDziennikPrzedszkole": f"{register_r['data'][0]['IdPrzedszkoleDziennik']}",
"idBiezacyDziennikWychowankowie": f"{register_r['data'][0]['IdWychowankowieDziennik']}",
"idBiezacyUczen": f"{register_r['data'][0]['IdUczen']}"
"biezacyRokSzkolny": f"{students['data'][0]['DziennikRokSzkolny']}",
"idBiezacyDziennik": f"{students['data'][0]['IdDziennik']}",
"idBiezacyDziennikPrzedszkole": f"{students['data'][0]['IdPrzedszkoleDziennik']}",
"idBiezacyDziennikWychowankowie": f"{students['data'][0]['IdWychowankowieDziennik']}",
"idBiezacyUczen": f"{students['data'][0]['IdUczen']}"
})
else:
cookies.update({
"biezacyRokSzkolny": f"{register_r['data'][0]['DziennikRokSzkolny']}",
"idBiezacyDziennik": f"{register_r['data'][0]['IdDziennik']}",
"idBiezacyDziennikPrzedszkole": f"{register_r['data'][0]['IdPrzedszkoleDziennik']}",
"idBiezacyUczen": f"{register_r['data'][0]['IdUczen']}"
"biezacyRokSzkolny": f"{students['data'][0]['DziennikRokSzkolny']}",
"idBiezacyDziennik": f"{students['data'][0]['IdDziennik']}",
"idBiezacyDziennikPrzedszkole": f"{students['data'][0]['IdPrzedszkoleDziennik']}",
"idBiezacyUczen": f"{students['data'][0]['IdUczen']}"
})
headers = {

View file

@ -1,22 +1,22 @@
import json
import requests
def get_grades(register_id, register_r, oun, s):
def get_grades(register_id, students, oun, s):
cookies = s
if oun != 'http://uonetplus-uczen.fakelog.cf/powiatwulkanowy/123458':
cookies.update({
"biezacyRokSzkolny": f"{register_r['data'][0]['DziennikRokSzkolny']}",
"idBiezacyDziennik": f"{register_r['data'][0]['IdDziennik']}",
"idBiezacyDziennikPrzedszkole": f"{register_r['data'][0]['IdPrzedszkoleDziennik']}",
"idBiezacyDziennikWychowankowie": f"{register_r['data'][0]['IdWychowankowieDziennik']}",
"idBiezacyUczen": f"{register_r['data'][0]['IdUczen']}"
"biezacyRokSzkolny": f"{students['data'][0]['DziennikRokSzkolny']}",
"idBiezacyDziennik": f"{students['data'][0]['IdDziennik']}",
"idBiezacyDziennikPrzedszkole": f"{students['data'][0]['IdPrzedszkoleDziennik']}",
"idBiezacyDziennikWychowankowie": f"{students['data'][0]['IdWychowankowieDziennik']}",
"idBiezacyUczen": f"{students['data'][0]['IdUczen']}"
})
else:
cookies.update({
"biezacyRokSzkolny": f"{register_r['data'][0]['DziennikRokSzkolny']}",
"idBiezacyDziennik": f"{register_r['data'][0]['IdDziennik']}",
"idBiezacyDziennikPrzedszkole": f"{register_r['data'][0]['IdPrzedszkoleDziennik']}",
"idBiezacyUczen": f"{register_r['data'][0]['IdUczen']}"
"biezacyRokSzkolny": f"{students['data'][0]['DziennikRokSzkolny']}",
"idBiezacyDziennik": f"{students['data'][0]['IdDziennik']}",
"idBiezacyDziennikPrzedszkole": f"{students['data'][0]['IdPrzedszkoleDziennik']}",
"idBiezacyUczen": f"{students['data'][0]['IdUczen']}"
})
headers = {

View file

@ -1,22 +1,22 @@
import requests
import json
def get_homeworks(register_id, register_r, oun, s, date, school_year):
def get_homeworks(register_id, students, oun, s, date, school_year):
cookies = s
if oun != 'http://uonetplus-uczen.fakelog.cf/powiatwulkanowy/123458':
cookies.update({
"biezacyRokSzkolny": f"{register_r['data'][0]['DziennikRokSzkolny']}",
"idBiezacyDziennik": f"{register_r['data'][0]['IdDziennik']}",
"idBiezacyDziennikPrzedszkole": f"{register_r['data'][0]['IdPrzedszkoleDziennik']}",
"idBiezacyDziennikWychowankowie": f"{register_r['data'][0]['IdWychowankowieDziennik']}",
"idBiezacyUczen": f"{register_r['data'][0]['IdUczen']}"
"biezacyRokSzkolny": f"{students['data'][0]['DziennikRokSzkolny']}",
"idBiezacyDziennik": f"{students['data'][0]['IdDziennik']}",
"idBiezacyDziennikPrzedszkole": f"{students['data'][0]['IdPrzedszkoleDziennik']}",
"idBiezacyDziennikWychowankowie": f"{students['data'][0]['IdWychowankowieDziennik']}",
"idBiezacyUczen": f"{students['data'][0]['IdUczen']}"
})
else:
cookies.update({
"biezacyRokSzkolny": f"{register_r['data'][0]['DziennikRokSzkolny']}",
"idBiezacyDziennik": f"{register_r['data'][0]['IdDziennik']}",
"idBiezacyDziennikPrzedszkole": f"{register_r['data'][0]['IdPrzedszkoleDziennik']}",
"idBiezacyUczen": f"{register_r['data'][0]['IdUczen']}"
"biezacyRokSzkolny": f"{students['data'][0]['DziennikRokSzkolny']}",
"idBiezacyDziennik": f"{students['data'][0]['IdDziennik']}",
"idBiezacyDziennikPrzedszkole": f"{students['data'][0]['IdPrzedszkoleDziennik']}",
"idBiezacyUczen": f"{students['data'][0]['IdUczen']}"
})
headres = {

View file

@ -4,7 +4,7 @@ import calendar
import time
import re
def get_received_messages(register_id, register_r, oun, s, date, school_year, symbol):
def get_received_messages(register_id, students, oun, s, date, school_year, symbol):
headers = {
'Accept-Encoding': 'gzip, deflate, br',
'Accept': '*/*',
@ -21,7 +21,7 @@ def get_received_messages(register_id, register_r, oun, s, date, school_year, sy
return received_messages.json()
def get_sent_messages(register_id, register_r, oun, s, date, school_year, symbol):
def get_sent_messages(register_id, students, oun, s, date, school_year, symbol):
headers = {
'Accept-Encoding': 'gzip, deflate, br',
'Accept': '*/*',
@ -38,7 +38,7 @@ def get_sent_messages(register_id, register_r, oun, s, date, school_year, symbol
return sent_messages.json()
def get_deleted_messages(register_id, register_r, oun, s, date, school_year, symbol):
def get_deleted_messages(register_id, students, oun, s, date, school_year, symbol):
headers = {
'Accept-Encoding': 'gzip, deflate, br7',
'Accept': '*/*',
@ -55,7 +55,7 @@ def get_deleted_messages(register_id, register_r, oun, s, date, school_year, sym
return deleted_messages.json()
def get_recipients(register_id, register_r, oun, s, date, school_year, symbol):
def get_recipients(register_id, students, oun, s, date, school_year, symbol):
headers = {
'Accept-Encoding': 'gzip, deflate, br',
'Accept': '*/*',
@ -77,7 +77,7 @@ def get_recipients(register_id, register_r, oun, s, date, school_year, symbol):
return {'addressee': get_addressee.json(), 'unitId': id_jednostka}
def send_message(register_id, register_r, oun, s, date, school_year, symbol, send_data):
def send_message(register_id, students, oun, s, date, school_year, symbol, send_data):
headers = {
'Accept-Encoding': 'gzip, deflate, br',
'Accet': '*/*',
@ -92,7 +92,7 @@ def send_message(register_id, register_r, oun, s, date, school_year, symbol, sen
else:
link = f'https://uonetplus-uzytkownik.vulcan.net.pl/{symbol}'
student_data = register_r['data'][0]['UczenNazwisko']+' '+register_r['data'][0]['UczenImie']
student_data = students['data'][0]['UczenNazwisko']+' '+students['data'][0]['UczenImie']
sess = requests.Session()
@ -157,7 +157,7 @@ def send_message(register_id, register_r, oun, s, date, school_year, symbol, sen
return send.json()
def get_message_content(register_id, register_r, oun, s, date, school_year, symbol, message_id):
def get_message_content(register_id, students, oun, s, date, school_year, symbol, message_id):
headers = {
'Accept-Encoding': 'gzip, deflate, br',
'Accept': '*/*',

View file

@ -1,22 +1,22 @@
import json
import requests
def get_registered_devices(register_id, register_r, oun, s):
def get_registered_devices(register_id, students, oun, s):
cookies = s
if oun != 'http://uonetplus-uczen.fakelog.cf/powiatwulkanowy/123458':
cookies.update({
"biezacyRokSzkolny": f"{register_r['data'][0]['DziennikRokSzkolny']}",
"idBiezacyDziennik": f"{register_r['data'][0]['IdDziennik']}",
"idBiezacyDziennikPrzedszkole": f"{register_r['data'][0]['IdPrzedszkoleDziennik']}",
"idBiezacyDziennikWychowankowie": f"{register_r['data'][0]['IdWychowankowieDziennik']}",
"idBiezacyUczen": f"{register_r['data'][0]['IdUczen']}"
"biezacyRokSzkolny": f"{students['data'][0]['DziennikRokSzkolny']}",
"idBiezacyDziennik": f"{students['data'][0]['IdDziennik']}",
"idBiezacyDziennikPrzedszkole": f"{students['data'][0]['IdPrzedszkoleDziennik']}",
"idBiezacyDziennikWychowankowie": f"{students['data'][0]['IdWychowankowieDziennik']}",
"idBiezacyUczen": f"{students['data'][0]['IdUczen']}"
})
else:
cookies.update({
"biezacyRokSzkolny": f"{register_r['data'][0]['DziennikRokSzkolny']}",
"idBiezacyDziennik": f"{register_r['data'][0]['IdDziennik']}",
"idBiezacyDziennikPrzedszkole": f"{register_r['data'][0]['IdPrzedszkoleDziennik']}",
"idBiezacyUczen": f"{register_r['data'][0]['IdUczen']}"
"biezacyRokSzkolny": f"{students['data'][0]['DziennikRokSzkolny']}",
"idBiezacyDziennik": f"{students['data'][0]['IdDziennik']}",
"idBiezacyDziennikPrzedszkole": f"{students['data'][0]['IdPrzedszkoleDziennik']}",
"idBiezacyUczen": f"{students['data'][0]['IdUczen']}"
})
headers = {
@ -30,22 +30,22 @@ def get_registered_devices(register_id, register_r, oun, s):
return registered.json()
def register_device(register_id, register_r, oun, s):
def register_device(register_id, students, oun, s):
cookies = s
if oun != 'http://uonetplus-uczen.fakelog.cf/powiatwulkanowy/123458':
cookies.update({
"biezacyRokSzkolny": f"{register_r['data'][0]['DziennikRokSzkolny']}",
"idBiezacyDziennik": f"{register_r['data'][0]['IdDziennik']}",
"idBiezacyDziennikPrzedszkole": f"{register_r['data'][0]['IdPrzedszkoleDziennik']}",
"idBiezacyDziennikWychowankowie": f"{register_r['data'][0]['IdWychowankowieDziennik']}",
"idBiezacyUczen": f"{register_r['data'][0]['IdUczen']}"
"biezacyRokSzkolny": f"{students['data'][0]['DziennikRokSzkolny']}",
"idBiezacyDziennik": f"{students['data'][0]['IdDziennik']}",
"idBiezacyDziennikPrzedszkole": f"{students['data'][0]['IdPrzedszkoleDziennik']}",
"idBiezacyDziennikWychowankowie": f"{students['data'][0]['IdWychowankowieDziennik']}",
"idBiezacyUczen": f"{students['data'][0]['IdUczen']}"
})
else:
cookies.update({
"biezacyRokSzkolny": f"{register_r['data'][0]['DziennikRokSzkolny']}",
"idBiezacyDziennik": f"{register_r['data'][0]['IdDziennik']}",
"idBiezacyDziennikPrzedszkole": f"{register_r['data'][0]['IdPrzedszkoleDziennik']}",
"idBiezacyUczen": f"{register_r['data'][0]['IdUczen']}"
"biezacyRokSzkolny": f"{students['data'][0]['DziennikRokSzkolny']}",
"idBiezacyDziennik": f"{students['data'][0]['IdDziennik']}",
"idBiezacyDziennikPrzedszkole": f"{students['data'][0]['IdPrzedszkoleDziennik']}",
"idBiezacyUczen": f"{students['data'][0]['IdUczen']}"
})
headers = {

View file

@ -1,22 +1,22 @@
import json
import requests
def get_notes(register_id, register_r, oun, s):
def get_notes(register_id, students, oun, s):
cookies = s
if oun != 'http://uonetplus-uczen.fakelog.cf/powiatwulkanowy/123458':
cookies.update({
"biezacyRokSzkolny": f"{register_r['data'][0]['DziennikRokSzkolny']}",
"idBiezacyDziennik": f"{register_r['data'][0]['IdDziennik']}",
"idBiezacyDziennikPrzedszkole": f"{register_r['data'][0]['IdPrzedszkoleDziennik']}",
"idBiezacyDziennikWychowankowie": f"{register_r['data'][0]['IdWychowankowieDziennik']}",
"idBiezacyUczen": f"{register_r['data'][0]['IdUczen']}"
"biezacyRokSzkolny": f"{students['data'][0]['DziennikRokSzkolny']}",
"idBiezacyDziennik": f"{students['data'][0]['IdDziennik']}",
"idBiezacyDziennikPrzedszkole": f"{students['data'][0]['IdPrzedszkoleDziennik']}",
"idBiezacyDziennikWychowankowie": f"{students['data'][0]['IdWychowankowieDziennik']}",
"idBiezacyUczen": f"{students['data'][0]['IdUczen']}"
})
else:
cookies.update({
"biezacyRokSzkolny": f"{register_r['data'][0]['DziennikRokSzkolny']}",
"idBiezacyDziennik": f"{register_r['data'][0]['IdDziennik']}",
"idBiezacyDziennikPrzedszkole": f"{register_r['data'][0]['IdPrzedszkoleDziennik']}",
"idBiezacyUczen": f"{register_r['data'][0]['IdUczen']}"
"biezacyRokSzkolny": f"{students['data'][0]['DziennikRokSzkolny']}",
"idBiezacyDziennik": f"{students['data'][0]['IdDziennik']}",
"idBiezacyDziennikPrzedszkole": f"{students['data'][0]['IdPrzedszkoleDziennik']}",
"idBiezacyUczen": f"{students['data'][0]['IdUczen']}"
})
headers = {

View file

@ -1,22 +1,22 @@
import json
import requests
def get_school_data(register_id, register_r, oun, s):
def get_school_data(register_id, students, oun, s):
cookies = s
if oun != 'http://uonetplus-uczen.fakelog.cf/powiatwulkanowy/123458':
cookies.update({
"biezacyRokSzkolny": f"{register_r['data'][0]['DziennikRokSzkolny']}",
"idBiezacyDziennik": f"{register_r['data'][0]['IdDziennik']}",
"idBiezacyDziennikPrzedszkole": f"{register_r['data'][0]['IdPrzedszkoleDziennik']}",
"idBiezacyDziennikWychowankowie": f"{register_r['data'][0]['IdWychowankowieDziennik']}",
"idBiezacyUczen": f"{register_r['data'][0]['IdUczen']}"
"biezacyRokSzkolny": f"{students['data'][0]['DziennikRokSzkolny']}",
"idBiezacyDziennik": f"{students['data'][0]['IdDziennik']}",
"idBiezacyDziennikPrzedszkole": f"{students['data'][0]['IdPrzedszkoleDziennik']}",
"idBiezacyDziennikWychowankowie": f"{students['data'][0]['IdWychowankowieDziennik']}",
"idBiezacyUczen": f"{students['data'][0]['IdUczen']}"
})
else:
cookies.update({
"biezacyRokSzkolny": f"{register_r['data'][0]['DziennikRokSzkolny']}",
"idBiezacyDziennik": f"{register_r['data'][0]['IdDziennik']}",
"idBiezacyDziennikPrzedszkole": f"{register_r['data'][0]['IdPrzedszkoleDziennik']}",
"idBiezacyUczen": f"{register_r['data'][0]['IdUczen']}"
"biezacyRokSzkolny": f"{students['data'][0]['DziennikRokSzkolny']}",
"idBiezacyDziennik": f"{students['data'][0]['IdDziennik']}",
"idBiezacyDziennikPrzedszkole": f"{students['data'][0]['IdPrzedszkoleDziennik']}",
"idBiezacyUczen": f"{students['data'][0]['IdUczen']}"
})
headers = {

View file

@ -1,22 +1,22 @@
import json
import requests
def get_student_data(register_id, register_r, oun, s):
def get_student_data(register_id, students, oun, s):
cookies = s
if oun != 'http://uonetplus-uczen.fakelog.cf/powiatwulkanowy/123458':
cookies.update({
"biezacyRokSzkolny": f"{register_r['data'][0]['DziennikRokSzkolny']}",
"idBiezacyDziennik": f"{register_r['data'][0]['IdDziennik']}",
"idBiezacyDziennikPrzedszkole": f"{register_r['data'][0]['IdPrzedszkoleDziennik']}",
"idBiezacyDziennikWychowankowie": f"{register_r['data'][0]['IdWychowankowieDziennik']}",
"idBiezacyUczen": f"{register_r['data'][0]['IdUczen']}"
"biezacyRokSzkolny": f"{students['data'][0]['DziennikRokSzkolny']}",
"idBiezacyDziennik": f"{students['data'][0]['IdDziennik']}",
"idBiezacyDziennikPrzedszkole": f"{students['data'][0]['IdPrzedszkoleDziennik']}",
"idBiezacyDziennikWychowankowie": f"{students['data'][0]['IdWychowankowieDziennik']}",
"idBiezacyUczen": f"{students['data'][0]['IdUczen']}"
})
else:
cookies.update({
"biezacyRokSzkolny": f"{register_r['data'][0]['DziennikRokSzkolny']}",
"idBiezacyDziennik": f"{register_r['data'][0]['IdDziennik']}",
"idBiezacyDziennikPrzedszkole": f"{register_r['data'][0]['IdPrzedszkoleDziennik']}",
"idBiezacyUczen": f"{register_r['data'][0]['IdUczen']}"
"biezacyRokSzkolny": f"{students['data'][0]['DziennikRokSzkolny']}",
"idBiezacyDziennik": f"{students['data'][0]['IdDziennik']}",
"idBiezacyDziennikPrzedszkole": f"{students['data'][0]['IdPrzedszkoleDziennik']}",
"idBiezacyUczen": f"{students['data'][0]['IdUczen']}"
})
headers = {

View file

@ -2,22 +2,22 @@ import json
import requests
from bs4 import BeautifulSoup
def get_timetable(register_id, register_r, oun, s, date):
def get_timetable(register_id, students, oun, s, date):
cookies = s
if oun != 'http://uonetplus-uczen.fakelog.cf/powiatwulkanowy/123458':
cookies.update({
"biezacyRokSzkolny": f"{register_r['data'][0]['DziennikRokSzkolny']}",
"idBiezacyDziennik": f"{register_r['data'][0]['IdDziennik']}",
"idBiezacyDziennikPrzedszkole": f"{register_r['data'][0]['IdPrzedszkoleDziennik']}",
"idBiezacyDziennikWychowankowie": f"{register_r['data'][0]['IdWychowankowieDziennik']}",
"idBiezacyUczen": f"{register_r['data'][0]['IdUczen']}"
"biezacyRokSzkolny": f"{students['data'][0]['DziennikRokSzkolny']}",
"idBiezacyDziennik": f"{students['data'][0]['IdDziennik']}",
"idBiezacyDziennikPrzedszkole": f"{students['data'][0]['IdPrzedszkoleDziennik']}",
"idBiezacyDziennikWychowankowie": f"{students['data'][0]['IdWychowankowieDziennik']}",
"idBiezacyUczen": f"{students['data'][0]['IdUczen']}"
})
else:
cookies.update({
"biezacyRokSzkolny": f"{register_r['data'][0]['DziennikRokSzkolny']}",
"idBiezacyDziennik": f"{register_r['data'][0]['IdDziennik']}",
"idBiezacyDziennikPrzedszkole": f"{register_r['data'][0]['IdPrzedszkoleDziennik']}",
"idBiezacyUczen": f"{register_r['data'][0]['IdUczen']}"
"biezacyRokSzkolny": f"{students['data'][0]['DziennikRokSzkolny']}",
"idBiezacyDziennik": f"{students['data'][0]['IdDziennik']}",
"idBiezacyDziennikPrzedszkole": f"{students['data'][0]['IdPrzedszkoleDziennik']}",
"idBiezacyUczen": f"{students['data'][0]['IdUczen']}"
})
headers = {

View file

@ -52,8 +52,8 @@ def send(url, data, fail, diary_url, symbol, s):
return cookies
def get_cookies(symbol, oun, s, diary_url):
register_r = s.post(oun+'/UczenDziennik.mvc/Get')
register_id = register_r.json()['data'][0]['Okresy'][0]['Id']
students = s.post(oun+'/UczenDziennik.mvc/Get')
register_id = students.json()['data'][0]['Okresy'][0]['Id']
now = datetime.datetime.now()
weekday = now.weekday()
@ -70,11 +70,11 @@ def get_cookies(symbol, oun, s, diary_url):
date = f'{date}T00:00:00'
school_year = register_r.json()['data'][0]['DziennikRokSzkolny']
school_year = students.json()['data'][0]['DziennikRokSzkolny']
data = {
'register_id': register_id,
'register_r': register_r.json(),
'students': students.json(),
'oun': oun,
'date': str(date),
'school_year': school_year,

View file

@ -55,12 +55,12 @@ def grades(request, *args, **kwargs):
if request.session.has_key('is_logged'):
data = json.loads(request.body)
register_id = data['data']['register_id']
register_r = data['data']['register_r']
students = data['data']['students']
oun = data['data']['oun']
s = data['data']['s']
key = bytes(request.session[request.session.session_key], 'utf-8')
s = decrypt_cookies(s, key)
grades = get_grades(register_id, register_r, oun, s)
grades = get_grades(register_id, students, oun, s)
return JsonResponse(grades)
else:
return redirect('../')
@ -69,13 +69,13 @@ def timetable(request, *args, **kwargs):
if request.session.has_key('is_logged'):
data = json.loads(request.body)
register_id = data['data']['register_id']
register_r = data['data']['register_r']
students = data['data']['students']
oun = data['data']['oun']
s = data['data']['s']
key = bytes(request.session[request.session.session_key], 'utf-8')
s = decrypt_cookies(s, key)
date = data['data']['date']
timetable = get_timetable(register_id, register_r, oun, s, date)
timetable = get_timetable(register_id, students, oun, s, date)
return JsonResponse(timetable)
else:
return redirect('../')
@ -84,14 +84,14 @@ def exams(request, *args, **kwargs):
if request.session.has_key('is_logged'):
data = json.loads(request.body)
register_id = data['data']['register_id']
register_r = data['data']['register_r']
students = data['data']['students']
oun = data['data']['oun']
s = data['data']['s']
key = bytes(request.session[request.session.session_key], 'utf-8')
s = decrypt_cookies(s, key)
date = data['data']['date']
school_year = data['data']['school_year']
exams = get_exams(register_id, register_r, oun, s, date, school_year)
exams = get_exams(register_id, students, oun, s, date, school_year)
return JsonResponse(exams)
else:
return redirect('../')
@ -100,14 +100,14 @@ def homeworks(request, *args, **kwargs):
if request.session.has_key('is_logged'):
data = json.loads(request.body)
register_id = data['data']['register_id']
register_r = data['data']['register_r']
students = data['data']['students']
oun = data['data']['oun']
s = data['data']['s']
key = bytes(request.session[request.session.session_key], 'utf-8')
s = decrypt_cookies(s, key)
date = data['data']['date']
school_year = data['data']['school_year']
homeworks = get_homeworks(register_id, register_r, oun, s, date, school_year)
homeworks = get_homeworks(register_id, students, oun, s, date, school_year)
return JsonResponse(homeworks)
else:
return redirect('../')
@ -116,13 +116,13 @@ def attendance(request, *args, **kwargs):
if request.session.has_key('is_logged'):
data = json.loads(request.body)
register_id = data['data']['register_id']
register_r = data['data']['register_r']
students = data['data']['students']
oun = data['data']['oun']
s = data['data']['s']
key = bytes(request.session[request.session.session_key], 'utf-8')
s = decrypt_cookies(s, key)
date = data['data']['date']
attendance = get_attendance(register_id, register_r, oun, s, date)
attendance = get_attendance(register_id, students, oun, s, date)
return JsonResponse(attendance, safe=False)
else:
return redirect('../')
@ -131,12 +131,12 @@ def notes(request, *args, **kwargs):
if request.session.has_key('is_logged'):
data = json.loads(request.body)
register_id = data['data']['register_id']
register_r = data['data']['register_r']
students = data['data']['students']
oun = data['data']['oun']
s = data['data']['s']
key = bytes(request.session[request.session.session_key], 'utf-8')
s = decrypt_cookies(s, key)
notes = get_notes(register_id, register_r, oun, s)
notes = get_notes(register_id, students, oun, s)
return JsonResponse(notes)
else:
return redirect('../')
@ -145,12 +145,12 @@ def registered_devices(request, *args, **kwargs):
if request.session.has_key('is_logged'):
data = json.loads(request.body)
register_id = data['data']['register_id']
register_r = data['data']['register_r']
students = data['data']['students']
oun = data['data']['oun']
s = data['data']['s']
key = bytes(request.session[request.session.session_key], 'utf-8')
s = decrypt_cookies(s, key)
registered = get_registered_devices(register_id, register_r, oun, s)
registered = get_registered_devices(register_id, students, oun, s)
return JsonResponse(registered)
else:
return redirect('../')
@ -159,12 +159,12 @@ def register_device_(request, *args, **kwargs):
if request.session.has_key('is_logged'):
data = json.loads(request.body)
register_id = data['data']['register_id']
register_r = data['data']['register_r']
students = data['data']['students']
oun = data['data']['oun']
s = data['data']['s']
key = bytes(request.session[request.session.session_key], 'utf-8')
s = decrypt_cookies(s, key)
register_data = register_device(register_id, register_r, oun, s)
register_data = register_device(register_id, students, oun, s)
return JsonResponse(register_data)
else:
return redirect('../')
@ -173,7 +173,7 @@ def received_messages(request, *args, **kwargs):
if request.session.has_key('is_logged'):
data = json.loads(request.body)
register_id = data['data']['register_id']
register_r = data['data']['register_r']
students = data['data']['students']
oun = data['data']['oun']
s = data['data']['s']
key = bytes(request.session[request.session.session_key], 'utf-8')
@ -181,7 +181,7 @@ def received_messages(request, *args, **kwargs):
date = data['data']['date']
school_year = data['data']['school_year']
symbol = data['data']['symbol']
received_messages = get_received_messages(register_id, register_r, oun, s, date, school_year, symbol)
received_messages = get_received_messages(register_id, students, oun, s, date, school_year, symbol)
return JsonResponse(received_messages)
else:
return redirect('../')
@ -190,7 +190,7 @@ def sent_messages(request, *args, **kwargs):
if request.session.has_key('is_logged'):
data = json.loads(request.body)
register_id = data['data']['register_id']
register_r = data['data']['register_r']
students = data['data']['students']
oun = data['data']['oun']
s = data['data']['s']
key = bytes(request.session[request.session.session_key], 'utf-8')
@ -198,7 +198,7 @@ def sent_messages(request, *args, **kwargs):
date = data['data']['date']
school_year = data['data']['school_year']
symbol = data['data']['symbol']
sent_messages = get_sent_messages(register_id, register_r, oun, s, date, school_year, symbol)
sent_messages = get_sent_messages(register_id, students, oun, s, date, school_year, symbol)
return JsonResponse(sent_messages)
else:
return redirect('../')
@ -207,7 +207,7 @@ def deleted_messages(request, *args, **kwargs):
if request.session.has_key('is_logged'):
data = json.loads(request.body)
register_id = data['data']['register_id']
register_r = data['data']['register_r']
students = data['data']['students']
oun = data['data']['oun']
s = data['data']['s']
key = bytes(request.session[request.session.session_key], 'utf-8')
@ -215,7 +215,7 @@ def deleted_messages(request, *args, **kwargs):
date = data['data']['date']
school_year = data['data']['school_year']
symbol = data['data']['symbol']
deleted_messages = get_deleted_messages(register_id, register_r, oun, s, date, school_year, symbol)
deleted_messages = get_deleted_messages(register_id, students, oun, s, date, school_year, symbol)
return JsonResponse(deleted_messages)
else:
return redirect('../')
@ -224,7 +224,7 @@ def recipients(request, *args, **kwargs):
if request.session.has_key('is_logged'):
data = json.loads(request.body)
register_id = data['data']['register_id']
register_r = data['data']['register_r']
students = data['data']['students']
oun = data['data']['oun']
s = data['data']['s']
key = bytes(request.session[request.session.session_key], 'utf-8')
@ -232,7 +232,7 @@ def recipients(request, *args, **kwargs):
date = data['data']['date']
school_year = data['data']['school_year']
symbol = data['data']['symbol']
recipients = get_recipients(register_id, register_r, oun, s, date, school_year, symbol)
recipients = get_recipients(register_id, students, oun, s, date, school_year, symbol)
return JsonResponse(recipients)
else:
return redirect('../')
@ -241,12 +241,12 @@ def school_data(request, *args, **kwargs):
if request.session.has_key('is_logged'):
data = json.loads(request.body)
register_id = data['data']['register_id']
register_r = data['data']['register_r']
students = data['data']['students']
oun = data['data']['oun']
s = data['data']['s']
key = bytes(request.session[request.session.session_key], 'utf-8')
s = decrypt_cookies(s, key)
school_data = get_school_data(register_id, register_r, oun, s)
school_data = get_school_data(register_id, students, oun, s)
return JsonResponse(school_data)
else:
return redirect('../')
@ -255,13 +255,13 @@ def dashboard(request, *args, **kwargs):
if request.session.has_key('is_logged'):
data = json.loads(request.body)
register_id = data['data']['register_id']
register_r = data['data']['register_r']
students = data['data']['students']
s = data['data']['s']
key = bytes(request.session[request.session.session_key], 'utf-8')
s = decrypt_cookies(s, key)
diary_url = data['data']['diary_url']
symbol = data['data']['symbol']
dashboard = get_dashboard(register_id, register_r, s, diary_url, symbol)
dashboard = get_dashboard(register_id, students, s, diary_url, symbol)
return JsonResponse(dashboard)
else:
return redirect('../')
@ -271,7 +271,7 @@ def send(request, *args, **kwargs):
data = json.loads(request.body)
cookies_data = json.loads(data['cookies_data'])
register_id = cookies_data['data']['register_id']
register_r = cookies_data['data']['register_r']
students = cookies_data['data']['students']
oun = cookies_data['data']['oun']
s = cookies_data['data']['s']
key = bytes(request.session[request.session.session_key], 'utf-8')
@ -280,7 +280,7 @@ def send(request, *args, **kwargs):
school_year = cookies_data['data']['school_year']
symbol = cookies_data['data']['symbol']
send_data = {'data': data['data'], 'subject': data['subject'], 'content': data['content']}
send = send_message(register_id, register_r, oun, s, date, school_year, symbol, send_data)
send = send_message(register_id, students, oun, s, date, school_year, symbol, send_data)
return JsonResponse(send, safe=False)
else:
return redirect('../')
@ -290,7 +290,7 @@ def message_content(request, *args, **kwargs):
data = json.loads(request.body)
cookies_data = json.loads(data['cookies_data'])
register_id = cookies_data['data']['register_id']
register_r = cookies_data['data']['register_r']
students = cookies_data['data']['students']
oun = cookies_data['data']['oun']
s = cookies_data['data']['s']
key = bytes(request.session[request.session.session_key], 'utf-8')
@ -299,7 +299,7 @@ def message_content(request, *args, **kwargs):
school_year = cookies_data['data']['school_year']
symbol = cookies_data['data']['symbol']
message_id = data['message_id']
content = get_message_content(register_id, register_r, oun, s, date, school_year, symbol, message_id)
content = get_message_content(register_id, students, oun, s, date, school_year, symbol, message_id)
return JsonResponse(content, safe=False)
else:
return redirect('../')
@ -308,12 +308,12 @@ def student_data(request, *args, **kwargs):
if request.session.has_key('is_logged'):
data = json.loads(request.body)
register_id = data['data']['register_id']
register_r = data['data']['register_r']
students = data['data']['students']
oun = data['data']['oun']
s = data['data']['s']
key = bytes(request.session[request.session.session_key], 'utf-8')
s = decrypt_cookies(s, key)
data = get_student_data(register_id, register_r, oun, s)
data = get_student_data(register_id, students, oun, s)
return JsonResponse(data)
else:
return redirect('../')

View file

@ -17,7 +17,7 @@ class AccountManager extends Component {
super(props)
this.handleChangeStudent = this.handleChangeStudent.bind(this)
var cookies_data = JSON.parse(sessionStorage.getItem('cookies_data'));
var students = cookies_data.data.register_r.data;
var students = cookies_data.data.students.data;
this.state.cookies_data = cookies_data;
this.state.students = students;
students.forEach((student) => {
@ -33,7 +33,7 @@ class AccountManager extends Component {
this.state.students.forEach((student) => {
if (student.UczenPelnaNazwa == this.state.student) {
console.log(this.state.cookies_data)
this.state.cookies_data.data.register_r.data = [student];
this.state.cookies_data.data.students.data = [student];
sessionStorage.setItem('cookies_data', JSON.stringify(this.state.cookies_data));
window.location.href = '/content/';
}