mirror of
https://github.com/Sheldan/Sissi.git
synced 2026-01-26 19:21:43 +00:00
[SIS-xxx] adding rendering of current Debra donation information
updating for Debra 2023 campaign adding internal rest api for debra information adding a debra button to receive information
This commit is contained in:
20
python/tools/migrations/economy-migration/legacy_loader.py
Normal file
20
python/tools/migrations/economy-migration/legacy_loader.py
Normal file
@@ -0,0 +1,20 @@
|
||||
import json
|
||||
|
||||
from dto import LegacyCredits
|
||||
|
||||
def load_all_credits():
|
||||
with open('settings.json') as warnings:
|
||||
lines = warnings.read()
|
||||
credit_obj = json.loads(lines)
|
||||
user_list = credit_obj['384734293238749']['MEMBER']['297910194841583616']
|
||||
all_credit_dtos = []
|
||||
for user in user_list:
|
||||
user_obj = user_list[user]
|
||||
dto = LegacyCredits()
|
||||
dto.credits = user_obj['balance']
|
||||
dto.user_id = user
|
||||
all_credit_dtos.append(dto)
|
||||
|
||||
print(f'loaded {len(all_credit_dtos)} credit entries.')
|
||||
return all_credit_dtos
|
||||
|
||||
Reference in New Issue
Block a user