Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

pirms 5 gadiem
pirms 5 gadiem
12345678910111213141516
  1. from django.conf import settings
  2. from django.http import HttpResponseRedirect
  3. from django.core.urlresolvers import reverse
  4. class Public(object):
  5. def process_request(self, request):
  6. if settings.PUBLIC is False and not request.user.is_authenticated():
  7. acceptable_paths = [
  8. '/login/',
  9. '/private/',
  10. '/register/',
  11. ]
  12. if request.path not in acceptable_paths:
  13. return HttpResponseRedirect(reverse('users:private'))