Tendrl / api

Tendrl API
GNU Lesser General Public License v2.1
16 stars 16 forks source link

User email-notification flag is checked as an string whereas its a boolean #415

Closed shtripat closed 6 years ago

shtripat commented 6 years ago

The details of user in etcd looks something like

{"name":"Admin","username":"admin","password_salt":"...","password_hash":"...","email":"xxx@yyy.com","role":"admin","email_notifications":false}"

whereas while listing the user in API layer the presenter looks something as below

    def single(user)
      {
        email: user.email,
        username: user.username,
        name: user.name,
        role: user.role,
        email_notifications: user.email_notifications == "true" ? true : false
      }

because of this use.email_notifications == "true" it always says in UI that email notifications is disabled.