Revision dda2e499 snf-astakos-app/astakos/im/views.py

b/snf-astakos-app/astakos/im/views.py
53 53
from django.contrib.auth.views import password_change
54 54
from django.core.exceptions import ValidationError
55 55
from django.db.models import Q
56
from django.views.decorators.http import require_http_methods
56 57

  
57 58
from astakos.im.models import AstakosUser, Invitation, ApprovalTerms
58 59
from astakos.im.activation_backends import get_backend, SimpleBackend
......
109 110
        return func(request, *args, **kwargs)
110 111
    return wrapper
111 112

  
113
@require_http_methods(["GET", "POST"])
112 114
@signed_terms_required
113 115
def index(request, login_template_name='im/login.html', profile_template_name='im/profile.html', extra_context={}):
114 116
    """
......
139 141
                           login_form = LoginForm(request=request),
140 142
                           context_instance = get_context(request, extra_context))
141 143

  
144
@require_http_methods(["GET", "POST"])
142 145
@login_required
143 146
@signed_terms_required
144 147
@transaction.commit_manually
......
217 220
                           invitation_form = form,
218 221
                           context_instance = context)
219 222

  
223
@require_http_methods(["GET", "POST"])
220 224
@login_required
221 225
@signed_terms_required
222 226
def edit_profile(request, template_name='im/profile.html', extra_context={}):
......
275 279
                           context_instance = get_context(request,
276 280
                                                          extra_context))
277 281

  
282
@require_http_methods(["GET", "POST"])
278 283
def signup(request, template_name='im/signup.html', on_success='im/signup_complete.html', extra_context={}, backend=None):
279 284
    """
280 285
    Allows a user to create a local account.
......
355 360
                           provider = provider,
356 361
                           context_instance=get_context(request, extra_context))
357 362

  
363
@require_http_methods(["GET", "POST"])
358 364
@login_required
359 365
@signed_terms_required
360 366
def feedback(request, template_name='im/feedback.html', email_template_name='im/feedback_mail.txt', extra_context={}):
......
407 413
                           feedback_form = form,
408 414
                           context_instance = get_context(request, extra_context))
409 415

  
416
@require_http_methods(["GET", "POST"])
410 417
def logout(request, template='registration/logged_out.html', extra_context={}):
411 418
    """
412 419
    Wraps `django.contrib.auth.logout` and delete the cookie.
......
432 439
    response.write(render_to_string(template, context_instance=context))
433 440
    return response
434 441

  
442
@require_http_methods(["GET", "POST"])
435 443
@transaction.commit_manually
436 444
def activate(request, greeting_email_template_name='im/welcome_email.txt', helpdesk_email_template_name='im/helpdesk_notification.txt'):
437 445
    """
......
492 500
            transaction.rollback()
493 501
            return index(request)
494 502

  
503
@require_http_methods(["GET", "POST"])
495 504
def approval_terms(request, term_id=None, template_name='im/approval_terms.html', extra_context={}):
496 505
    term = None
497 506
    terms = None
......
532 541
                               approval_terms_form = form,
533 542
                               context_instance = get_context(request, extra_context))
534 543

  
544
@require_http_methods(["GET", "POST"])
535 545
@signed_terms_required
536 546
def change_password(request):
537 547
    return password_change(request,
538 548
                            post_change_redirect=reverse('astakos.im.views.edit_profile'),
539 549
                            password_change_form=ExtendedPasswordChangeForm)
540 550

  
551
@require_http_methods(["GET", "POST"])
552
@login_required
553
@signed_terms_required
541 554
@transaction.commit_manually
542 555
def change_email(request, activation_key=None,
543 556
                 email_template_name='registration/email_change_email.txt',

Also available in: Unified diff