Beispiel #1
0
 def authenticated(self, widget, data):
     if not authenticated(self.request):
         raise ExtractionError(u'Invalid Credentials')
Beispiel #2
0
 def test_authenticated(self):
     request = self.layer.new_request()
     self.assertEqual(authenticated(request), None)
     with self.layer.authenticated('max'):
         self.assertEqual(authenticated(request), 'max')
 def test_authenticated(self):
     request = self.layer.new_request()
     self.assertEqual(authenticated(request), None)
     with self.layer.authenticated('max'):
         self.assertEqual(authenticated(request), 'max')
Beispiel #4
0
 def __call__(self, model, request):
     if not authenticated(request):
         return render_tile(model, request, 'loginform')
     return Tile.__call__(self, model, request)