-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathusers.py
28 lines (26 loc) · 835 Bytes
/
users.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
class CreateUser:
def __init__(self):
self.first_name = input("Enter your First name: ")
self.last_name = input("Enter you Last Name: ")
self.email = input("Enter your Email: ")
self.confirm_email = input("Confirm your Email: ")
def email_check(self):
if self.email == self.confirm_email:
print("You are in the club!")
class Post_User(CreateUser):
def __init__(self):
super().__init__()
self.user_data = {
"user" :
{
"firstName" : self.first_name,
"lastName" : self.last_name,
"email" : self.email
}
}
import requests
import os
self.endpoint = str(os.getenv("sheety_users_endpoint"))
if self.email == self.confirm_email:
post_request = requests.post(url = self.endpoint, json = self.user_data)
print(post_request.text)