So I simply want to use the delete() from the django.contrib.comments.views.moderation module, but only allowing the users with permission to delete their comments. In order to do this, all I have to do is uncomment #@permission_required("comments.delete_comment")
, but I want to be able to do this without modifying the django framework. How can I modify/extend this view to my project? I guess the better question would be, what is the best way to change the setting for the delete() without changing anything in the django framework?
Asked
Active
Viewed 75 times
0

rk919
- 307
- 2
- 6
- 13
1 Answers
0
That line is only commented out because Django 1.1 maintains compatibility with Python 2.3 which doesn't support the decorator (@
) syntax. But the view is decorated with permission_required
nonetheless (with syntax that is compatible with Python 2.3), as you can see here. Django 1.2 will drop support for Python 2.3 and will switch to the @
-syntax. This is already visible on trunk.
Bottom line: you have to do nothing, as Django does already exactly what you want (this seems to be a recurring theme with Django :-) ).

Benjamin Wohlwend
- 30,958
- 11
- 90
- 100
-
Okay, it was working fine. However, I want to be able to give permission for non-staff users to be able to delete their own comments. How can I go about with doing that? – rk919 Feb 22 '10 at 22:12
-
That's a completely different question. If my answer was satisfactory with respect to your original question, please mark it as such and write a new question. Thanks :) – Benjamin Wohlwend Feb 22 '10 at 23:27