abartov / bybeconv

Project Ben-Yehuda's content management system.
https://benyehuda.org/
Other
10 stars 5 forks source link

Possible proofs refactoring #311

Open damisul opened 3 months ago

damisul commented 3 months ago

I see from data model, that Proof can belong either to manifestation, or to html_files. But I don't see latter variant being used in code. I wonder if we can drop html_file_id from proofs table?

Also I see that we have reporter field of type User defined in Proof model, but also don't see it being used in code. As far as I see, Proofs can be created even by unauthenticated users. I believe we can either drop this field from table, or put it in use, e.g. if Proof form is called by authenticated user, then hide email field from it and fill reporter with current user.

WDYT?

abartov commented 3 months ago

Yeah. Proofs were the very first component implemented in the DB, back when the entire library was in static HTML files. Hence the html_file_id. We are years past it, and no longer need it. That foreign key can be dropped.

As for reporter, that was indeed the intent, and it could be nice when regular users, who may well be logged in (and we are gradually giving people more and more reasons to log in) when report an error, won't have to type their email address over and over again, so let's leave that field there for now, for possibly implementing in the future, but I don't want to spend time on it now.