cute puppy warning

This commit is contained in:
red 2025-12-05 13:40:22 +00:00
parent 1ac5f5c1f7
commit ea5842d292
3 changed files with 13 additions and 8 deletions

View File

@ -14,16 +14,16 @@ class ParticipantController extends Controller
return response()->json(['message' => 'Unauthorized: Wrong password'], 401);
}
if(!Participant::where('id', $id)->exists()) {
if(!Participant::where('user_id', $id)->exists()) {
$participant = Participant::create([
'user_id' => $id,
'token' => (string) Str::ulid()
'token' => uniqid()
]);
return $participant->token;
}
else {
$participant = Participant::where('id', $id)->first();
$participant = Participant::where('user_id', $id)->first();
return $participant->token;
}
}

View File

@ -64,17 +64,22 @@ async def make_new_json_request(user_id: int):
async with aiohttp.ClientSession() as session:
async with session.post(url, json=data, headers=headers) as response:
response_text = await response.text()
if(len(response_text) < 14):
return response_text
else:
return False
async def post_chat_update(session: aiohttp.ClientSession, chat_object: Dict[str, Any], xsrf_token: str):
pattern = r'/(\d+)/'
match = re.search(pattern, chat_object.get('icon_url'))
token = await make_new_json_request(match.group(1))
form_data = aiohttp.FormData()
if(token):
form_data.add_field('text', f"""You've signed up for the Secret Sketchers event, your link is http://localhost/profile/{token} - it is private and should only be used by you.
\nDon't want to be in it anymore? Go to http://localhost/withdraw/{token} - note that withdrawing is permanent and you cannot re-enter the event.""")
else:
form_data.add_field('text', f"""Something went wrong, Sorry I will fix it sooner or later... maybe""")
headers = get_post_headers(xsrf_token)

View File

@ -24,7 +24,7 @@ class ParticipantFactory extends Factory
public function definition(): array
{
return [
'token' => (string) Str::ulid(),
'token' => uniqid(),
];
}