Skip to content

Conversation

@AbuBakar-crypthone
Copy link
Collaborator

…tegration with alembic

SECRET_KEY = "af3287c8391bb9f4f7a72feb3b85f72e1d5bd07cbf4fa4ad9497c78412923312"
ALGORITHM = "HS256"
ACCESS_TOKEN_EXPIRE_MINUTES = 30
ACCESS_TOKEN_EXPIRE_MINUTES = 7 * 24 * 60

Choose a reason for hiding this comment

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

dont need to define time like this just write minutes or seconds

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ok

Comment on lines 18 to 23
new_company = Company(
name=company_data.name,
location=company_data.location,
type=company_data.type,
user_id=user_id
)

Choose a reason for hiding this comment

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

instead of doing this make sure this is already coming from request as an object just call the repository here in service and do database insertions there

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

i fix this today

type=company_data.type,
user_id=user_id
)
self.db.add(new_company)

Choose a reason for hiding this comment

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

do this in repository and dont use self with it

new_user = User(username=user.username, password=hashed_pw)
self.db.add(new_user)
self.db.commit()
self.db.refresh(new_user)

Choose a reason for hiding this comment

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

dont need to use db.refresh untill it is necessary

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