From d4d3ec31318d0e25c3ab5ae2a99d68b1d03ff011 Mon Sep 17 00:00:00 2001 From: LEVY-FALK Hugo Date: Tue, 28 Nov 2017 23:13:13 +0100 Subject: [PATCH] Documentation. --- users/views.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/users/views.py b/users/views.py index 0781c374..1ccdd980 100644 --- a/users/views.py +++ b/users/views.py @@ -110,7 +110,11 @@ def password_change_action(u_form, user, request, req=False): )) def can_create(model): - """Decorator to check if an user can create a model. """ + """Decorator to check if an user can create a model. + It assumes that a valid user exists in the request and that the model has a + method can_create(user) which returns true if the user can create this kind + of models. + """ def decorator(view): def wrapper(request,*args, **kwargs): if not model.can_create(request.user):