Commits

Anonymous committed 9c56df8

set all views to never cache so there are not perceived conflicts for multiple moderators. added decorator to require moderators have the change_registrationprofile permission

  • Participants
  • Parent commits 64d318f

Comments (0)

Files changed (1)

File registration/views.py

 from django.shortcuts import redirect
 from django.shortcuts import render_to_response
 from django.template import RequestContext
+from django.views.decorators.cache import never_cache
+from django.contrib.auth.decorators import permission_required
 
 from registration import signals
 from registration.backends import get_backend
         'form': form
     }, context_instance=RequestContext(request))
 
+@never_cache
 def activate(request, backend, template_name='registration/activate.html', **kwargs):
     backend = get_backend(backend)
     profile = backend.get_profile(request, **kwargs)
         'moderation_required': moderation_required,
     }, context_instance=RequestContext(request))
 
+@never_cache
 def verify(request, backend, template_name='registration/registration_verify.html', **kwargs):
     backend = get_backend(backend)
     verified = backend.verify(request, **kwargs)
         'verified': verified,
     }, context_instance=RequestContext(request))
 
-
+@never_cache
 def moderate(request, backend, template_name='registration/registration_moderate.html', **kwargs):
     backend = get_backend(backend)
 
         'profile': profile,
     }, context_instance=RequestContext(request))
 
-
+@permission_required('registration.change_registrationprofile')
+@never_cache
 def moderate_list(request, backend, template_name='registration/registration_moderate_list.html'):
     backend = get_backend(backend)
     profiles = backend.get_profiles(request)