Closed botanicvelious closed 5 years ago
@botanicvelious I'd like to work on this one. :)
go for it
https://github.com/ntkomata/python-blogs @botanicvelious I tried to add certain fields to readonly_fields when the user is student, but it threw an error saying "unknown fields". just run the server, and log in (i made "admin" a student), and change or create a new article and you'll see the error.
Try get_fields, see if you can find what they are,
https://docs.djangoproject.com/en/2.1/ref/models/meta/
Options.get_fields(include_parents=True, include_hidden=False)[source]¶
Could be that you arent accessing the correct field
@botanicvelious just checked the fields. Turns out there are 3 sets of fields from ArticleAdmin, ArticleForm and the Article model, which seems complicated and messy. Maybe I should make some changes to permissions instead of form fields. :)
So long as the student cant change those fields however you go about it is fine by me! 👍
This task is to not allow non super user users when adding a blog post article to not be able to change the following.