PlaidWeb / Publ

Flexible publishing system for the web
http://publ.beesbuzz.biz/
MIT License
41 stars 4 forks source link

`view.tags` should be case-normalized #430

Closed fluffy-critter closed 3 years ago

fluffy-critter commented 3 years ago

Expected Behavior

The view.tags list should be case-normalized to what the database records the tags' capitalization as

Current Behavior

It comes back with whatever case was provided in e.g. the URL

Possible Solution

@cached_property
def tags(self):
    result = []
    for tag in view.tags:
        record = model.EntryTag.get(key=tag.casefold())
        result.append(record.name if record else tag)
    return result

or something

Steps to Reproduce (for bugs)

1. 2. 3. 4.

Context