Skip to content

i have modified Bank application.md file #5

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

Merged
merged 1 commit into from
Jan 25, 2024
Merged

i have modified Bank application.md file #5

merged 1 commit into from
Jan 25, 2024

Conversation

sandeeep-prajapati
Copy link
Contributor

Dear HalilDeniz,

I trust this message finds you well. My name is Sandeep Prajapati, a dedicated B.Tech student pursuing Computer Science. Firstly, I would like to express my sincere gratitude for the invaluable assistance your repository has provided me during my academic journey. Your efforts have been instrumental in my learning process, and for that, I am truly thankful.

I wanted to bring to your attention a recent addition to the codebase that I believe may enhance the user experience. I have implemented a validation feature to address a scenario where an existing user attempts to create a new account. In such cases, the system now gracefully blocks the operation and provides a friendly prompt, suggesting an alternative username. The updated code is as follows:

def user_already_exist(self):
    username = input("Enter a username: ")
    self.cursor.execute("SELECT username FROM accounts WHERE username = ?", (username,))
    account = self.cursor.fetchone()
    if account:
        print("Username already in use. Please choose another one.")
        self.user_already_exist()
    else:
        return username

def create_account(self, username, password):
    hashed_password = hashlib.sha256(password.encode()).hexdigest()
    self.cursor.execute("INSERT INTO accounts (username, password, balance) VALUES (?,?,?)", (username, hashed_password, 0.0))
    self.conn.commit()
    print("Account created successfully.")

I believe this enhancement aligns with the overall goal of improving user interactions and satisfaction within the application.

If you find this modification suitable, I would be honored if you consider incorporating it into the repository. Your guidance and mentorship have been invaluable, and contributing to your project would be a privilege.

Thank you once again for your impactful work. Wishing you a pleasant day ahead.

Warm regards,
Sandeep Prajapati

…ture when a old user came here and try to create new account it blocks and send print messsage try something else

kindly merge it, i am computer science student and this repo was very helpful sir. i will be my pleaser to add my code in your repo      thankyou have a nice day Sandeep Prajapati
@HalilDeniz
Copy link
Owner

Hello my dear reader Sandeep, first of all, I would like to thank you for your nice comment. My work was not useful for you, but it was enough for me.
Of course, it is my honor to accept your request.

@HalilDeniz HalilDeniz merged commit c442167 into HalilDeniz:main Jan 25, 2024
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