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

Delete entry if registration is cancelled #4

Open
jamestiotio opened this issue Feb 9, 2020 · 0 comments
Open

Delete entry if registration is cancelled #4

jamestiotio opened this issue Feb 9, 2020 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@jamestiotio
Copy link
Owner

The Firestore Database entry for a specific user_id should be deleted if they cancelled the registration process:

hostelhunt/app.py

Lines 338 to 343 in f9e496d

# Cancel function for registration conversation
def cancel(bot, update):
bot.send_message(chat_id=update.message.chat_id,
text='The current registration process has been cancelled.')
return ConversationHandler.END

Or if they sent a student_id that has already been registered:

hostelhunt/app.py

Lines 207 to 209 in f9e496d

else:
if int(student_id) in pb.get_all_current_student_id():
msg = "Student ID already registered!"

This is to not clutter the database with unnecessary entries. A new function in firebase_connector.py would need to be created to delete entries, which would be called at the corresponding aforementioned conditions.

@jamestiotio jamestiotio added the enhancement New feature or request label Feb 9, 2020
@jamestiotio jamestiotio self-assigned this Feb 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant