Commit 845191001660854263ea1c8f53313292d102b498

Authored by Sergio Oliveira
1 parent 322a7b57

Adding accounts app (with auth backend)

src/accounts/__init__.py 0 → 100644
src/accounts/auth.py 0 → 100644
... ... @@ -0,0 +1,10 @@
  1 +
  2 +from django_browserid.auth import BrowserIDBackend
  3 +
  4 +class ColabBrowserIDBackend(BrowserIDBackend):
  5 + def filter_users_by_email(self, email):
  6 + return self.User.objects.filter(emails__address=email)
  7 +
  8 + def authenticate(self, *args, **kw):
  9 + #import pdb; pdb.set_trace();
  10 + return super(ColabBrowserIDBackend, self).authenticate(*args, **kw)
... ...
src/accounts/models.py 0 → 100644
... ... @@ -0,0 +1,3 @@
  1 +from django.db import models
  2 +
  3 +# Create your models here.
... ...
src/accounts/tests.py 0 → 100644
... ... @@ -0,0 +1,16 @@
  1 +"""
  2 +This file demonstrates writing tests using the unittest module. These will pass
  3 +when you run "manage.py test".
  4 +
  5 +Replace this with more appropriate tests for your application.
  6 +"""
  7 +
  8 +from django.test import TestCase
  9 +
  10 +
  11 +class SimpleTest(TestCase):
  12 + def test_basic_addition(self):
  13 + """
  14 + Tests that 1 + 1 always equals 2.
  15 + """
  16 + self.assertEqual(1 + 1, 2)
... ...
src/accounts/views.py 0 → 100644
... ... @@ -0,0 +1 @@
  1 +# Create your views here.
... ...
src/colab/custom_settings.py
... ... @@ -29,6 +29,7 @@ INSTALLED_APPS = INSTALLED_APPS + (
29 29 'rss',
30 30 'colab.deprecated',
31 31 'planet',
  32 + 'accounts',
32 33  
33 34 # Feedzilla and deps
34 35 'feedzilla',
... ...