mirror of
https://github.com/aaronleetw/Attendance.git
synced 2024-11-14 19:11:39 -08:00
Change signature naming from random to defined
This commit is contained in:
parent
16250857df
commit
ab40bcfa26
1 changed files with 3 additions and 3 deletions
6
app.py
6
app.py
|
@ -7,7 +7,6 @@ import csv
|
||||||
import os
|
import os
|
||||||
import pandas as pd
|
import pandas as pd
|
||||||
import base64
|
import base64
|
||||||
from random import randint
|
|
||||||
from dotenv import load_dotenv
|
from dotenv import load_dotenv
|
||||||
import requests
|
import requests
|
||||||
load_dotenv()
|
load_dotenv()
|
||||||
|
@ -307,7 +306,8 @@ def group_teach_publish():
|
||||||
formData.pop('notes')
|
formData.pop('notes')
|
||||||
signature = signature.removeprefix('data:image/png;base64,')
|
signature = signature.removeprefix('data:image/png;base64,')
|
||||||
signature = bytes(signature, 'utf-8')
|
signature = bytes(signature, 'utf-8')
|
||||||
rand = str(randint(100000000000000, 999999999999999))
|
rand = str(date + '^' + cclass['category'] +
|
||||||
|
'^' + cclass['class_id'] + '^' + period)
|
||||||
rand += ".png"
|
rand += ".png"
|
||||||
with open(os.path.join('temp', rand), "wb") as fh:
|
with open(os.path.join('temp', rand), "wb") as fh:
|
||||||
fh.write(base64.decodebytes(signature))
|
fh.write(base64.decodebytes(signature))
|
||||||
|
@ -355,7 +355,7 @@ def homeroom_abs_publish():
|
||||||
formData.pop('notes')
|
formData.pop('notes')
|
||||||
signature = signature.removeprefix('data:image/png;base64,')
|
signature = signature.removeprefix('data:image/png;base64,')
|
||||||
signature = bytes(signature, 'utf-8')
|
signature = bytes(signature, 'utf-8')
|
||||||
rand = str(randint(100000000000000, 999999999999999))
|
rand = str(date + '^' + homeroom[0] + '^' + homeroom[1] + '^' + period)
|
||||||
rand += ".png"
|
rand += ".png"
|
||||||
with open(os.path.join('temp', rand), "wb") as fh:
|
with open(os.path.join('temp', rand), "wb") as fh:
|
||||||
fh.write(base64.decodebytes(signature))
|
fh.write(base64.decodebytes(signature))
|
||||||
|
|
Loading…
Reference in a new issue