EwetoyeIbrahim / Equimolar-Blog

A Flask Blog for publishing articles by multiple users
1 stars 0 forks source link

Using capital tag when the same tag (always lowercased) already exist result in Error #14

Open EwetoyeIbrahim opened 4 years ago

EwetoyeIbrahim commented 4 years ago

How to reproduce:

  1. create a post with tag, say odoo or Odoo and save
  2. create another post with tag, say Odoo and save

Expected behaviour: The system lowercase the tags and save

Seen Behaviour: sqlalchemy.exc.IntegrityError: (raised as a result of Query-invoked autoflush; consider using a session.no_autoflush block if this flush is occurring prematurely) (sqlite3.IntegrityError) UNIQUE constraint failed: tags.name

EwetoyeIbrahim commented 4 years ago

Cause: The system flags the tag as a new one, then tries to lowercase and save it resulting to the violation of the Unique constraints on tag names.