Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

create #1

wants to merge 1 commit into from

Conversation

StuMason
Copy link
Owner

No description provided.

self, email: str, request_datetime: datetime, full_name: str
) -> dict:

signup = self.createSignupObject(full_name, request_datetime)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Signup not being used anywhere?

p = Process(target=self.c, args=(email, full_name, request_datetime))
p.start()

def c(self, email, full_name, request_datetime):
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

function name not explicit

Item={
'email': email,
"uuid": str(uuid.uuid4()),
"name": full_name,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

duplicate code between this and createSignupObject


signup = self.createSignupObject(full_name, request_datetime)

p = Process(target=self.c, args=(email, full_name, request_datetime))
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why a child process is being created to make a call to dynamodb

response = client.create('[email protected]', '11/10/2020', 'Stu Mason')


print(result)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No assertion?

dynamodb = boto3.resource("dynamodb", region_name="eu-west-1")

table = dynamodb.create_table(
TableName="contacts",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Table used is signup, but this is creating contacts


p = Process(target=self.c, args=(email, full_name, request_datetime))
p.start()

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function isn't returning anything. It's supposed to return a dict

Comment on lines +49 to +63
ContactWrite:
Type: AWS::Serverless::Function
Properties:
CodeUri: .
Handler: handler_c_contact.h
Runtime: python3.7
Policies:
- AmazonDynamoDBFullAccess
Events:
Write:
Type: Api
Properties:
Path: /write
RestApiId: !Ref SignupApi
Method: POST
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

spacing wrong, handler name sucks, policy is too much (just be read/write on the signups table would be idea)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants