Curiouspaul1 / telegram-business

Telegram-business is a bot that aims to help small-scale businesses grow by connecting them to prospective buyers..
7 stars 6 forks source link

Unwanted spaces and Capitalizations #2

Open shukkkur opened 2 years ago

shukkkur commented 2 years ago

https://github.com/Curiouspaul1/telegram-business/blob/8ca9209f9f174c6ee9db97250c9487a48fbf3b8c/handlers.py#L185-L194

Since it's possible to expect anything from the user, wouldn't it be safer to strip and lower case the string inputs?

 new_user = client.query( 
     q.create(q.collection('User'), { 
         "data":{ 
             "name":data[0].strip().lower(), 
             "email":data[1].strip().lower(), 
             "telephone":data[2], 
             "is_smeowner":False, 
             "preference": "", 
             "chat_id":chat_id 
         } 

Like this?

Curiouspaul1 commented 2 years ago

yeah that makes sense, do you want to fix that and send a PR?

shukkkur commented 2 years ago

@Curiouspaul1 Sure, will do!

Curiouspaul1 commented 2 years ago

@shukkkur how's the PR coming along, also any feedbacks on the new updates i made to fix the issue?. Is it working well?