fedora-infra / bodhi

Bodhi is a web-system that facilitates the process of publishing updates for a Fedora-based software distribution.
https://bodhi.fedoraproject.org
GNU General Public License v2.0
153 stars 195 forks source link

Templating logic in the model #2998

Open abitrolly opened 5 years ago

abitrolly commented 5 years ago

I revisited my failed attempt https://github.com/fedora-infra/bodhi/pull/2155 to add link to more information about updated package such as https://apps.fedoraproject.org/packages/qesteidutil to update page and after grepping the source found that update model contains templating logic.

https://github.com/fedora-infra/bodhi/blob/a2f925d7aedbc9057634ff4129f129f45dfe7b54/bodhi/server/models.py#L2372

bowlofeggs commented 5 years ago

Yeah, it's a little awkward to have HTML-aware code in the model. I think it would probably be cleaner if it just had a nice rendering of a human readable title and then have the template code fix the & character as needed with a filter.

abitrolly commented 5 years ago

It will be cleaner if model just exposed all the names, and allow the actual formatting to be done in the template. For example, it is missing packages' array with names such asqesteidutil` that the update instance covers. Can updates cover separate issues?

There is also a separate issue that it is impossible to trace to model from the template. There is no explicit link in the source code and I still don't understand how it ends up being used in the template.

https://github.com/fedora-infra/bodhi/blob/7a40b40bdd3065bdd40261ae66ec29e54173e8b6/bodhi/server/services/updates.py#L103-L125