Account creation.
All checks were successful
devranta build / Build (push) Successful in 1m27s

This commit is contained in:
retoor 2024-12-14 04:17:48 +01:00
parent 5d464ad271
commit 6a14dbe91a

View File

@ -71,6 +71,23 @@ class Api:
await self.session.close() await self.session.close()
self.session = None self.session = None
async def register_user(self, email, username, password):
response = None
async with self as session:
response = await session.post(
url=self.patch_url(f"devrant/rants/{rant_id}/comments"),
data=self.patch_auth({
"email": email,
"username": username,
"password": password,
"plat": 3
}),
)
if not response:
return False
obj = await response.json()
return obj.get('success', False)
async def get_comments_from_user(self, username): async def get_comments_from_user(self, username):
user_id = await self.get_user_id(username) user_id = await self.get_user_id(username)
profile = await self.get_profile(user_id) profile = await self.get_profile(user_id)