Renaming an article triggers an error, if article exists
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Widelands Website |
Fix Released
|
Medium
|
Unassigned |
Bug Description
On my local copy of widelands-website, there is an error if i try to change the title of an article to an existing title.
How to reproduce:
Make 2 articles with some contents, e.g. "Main Page" and "RedirectPage"
Edit "RedirectPage" and change the title to "Main Page"
See attached file django-Error.txt for errormessage.
If i go to the admin site (http://
Because of every logged in user has the ability to change the title of an article, the error should not be happen. Solutions:
1. hide the title field for normal users: Easy to implement but only admins could change an articletitle
2. if an article with the prefferred titel exists, prevent the title-change ("An article with this title allready exists").
Related branches
- SirVer: Approve (code)
-
Diff: 402 lines (+188/-44)10 files modifiedtemplates/admin/wiki/article/change_form.html (+9/-0)
templates/wiki/backlinks.html (+38/-0)
templates/wiki/edit.html (+4/-4)
templates/wiki/view.html (+9/-0)
wiki/admin.py (+5/-5)
wiki/forms.py (+24/-8)
wiki/migrations/0002_auto_20161218_1056.py (+19/-0)
wiki/models.py (+2/-2)
wiki/urls.py (+3/-0)
wiki/views.py (+75/-25)
Changed in widelands-website: | |
assignee: | nobody → kaputtnik (franku) |
importance: | Undecided → Medium |
status: | New → In Progress |
Changed in widelands-website: | |
status: | In Progress → Fix Released |
assignee: | kaputtnik (franku) → nobody |
> If i go to the admin site (http:// localhost: 8000/admin/ wiki/article/) i could see article "Main Page" twice: One with the original content and one with content of "RedirectPage". Possibilities: Delete one of them or change the title of one of them.
Changing the title will return the original page, but the slug gets lost. So history-view do not work anymore and editing an article will trigger another error. The new edits is stored as well.