run-development:
- docker-compose -f docker-compose.yml -f docker-compose.db.yml -f docker-compose.development.yml up
+ docker-compose -f docker-compose.yml -f docker-compose.db.yml -f docker-compose.development.yml up --build
run-test:
docker rm -v sirius-database-test || true
sirius:
depends_on:
- sirius-database-test
+ ports:
+ - 5000:5000
command: "bin/wait-for-it.sh sirius-database-test:5432 -- bin/docker-entrypoint.sh"
environment:
- DATABASE_URL=postgresql://postgres:plop@sirius-database-test/sirius-test
Flask==0.12.4
Flask-Bootstrap==3.3.7.1
Flask-Cors==3.0.8
-Flask-Login==0.2.11
-Flask-Migrate==1.2.0
+Flask-Login==0.4.1
+Flask-Migrate==2.5.2
git+https://github.com/mitsuhiko/flask-oauth@af6432621a9add5e55b0d7638e1380f66f3d4ed0#egg=Flask-OAuth
Flask-SQLAlchemy==2.4.0
Flask-Script==2.0.6
Jinja2==2.10.1
Mako==1.1.0
MarkupSafe==1.1.1
-pillow==2.9.0
+Pillow==6.1.0
SQLAlchemy==1.3.8
WTForms==2.2.1
Werkzeug==0.15.6
itsdangerous==1.1.0
nose==1.3.7
oauth2==1.9.0.post1
-oauthlib==0.7.2
+oauthlib==3.1.0
psycopg2-binary==2.8.3
pycrypto==2.6.1
redis==3.3.8
return 'User {}'.format(self.username)
# Flask-login interface:
+ @property
def is_active(self):
return True
- def get_id(self):
- return self.id
-
+ @property
def is_authenticated(self):
return True
+ def get_id(self):
+ return self.id
+
def generate_api_key(self):
self.api_key = ''.join(random.choice(string.ascii_letters + string.digits) for _ in range(32))
@blueprint.route('/')
def landing():
- if not login.current_user.is_authenticated():
+ if not login.current_user.is_authenticated:
return flask.render_template('landing.html')
return overview()
<li{% if request.url_rule.endpoint == "landing.landing" %} class="active"{% endif %}><a href="{{ url_for('landing.landing') }}">Home</a></li>
<li{% if request.url_rule.endpoint == "landing.about" %} class="active"{% endif %}><a href="{{ url_for('landing.about') }}">About</a></li>
</ul>
- {% if current_user.is_authenticated() %}
+ {% if current_user.is_authenticated %}
<ul class="nav navbar-nav navbar-right">
<li><a href="/twitter/logout">Sign out</a></li>
</ul>
return app
def test_oauth_authorized(self):
- self.assertEqual(login.current_user.is_authenticated(), False)
+ self.assertEqual(login.current_user.is_authenticated, False)
twitter.process_authorization(
'token',
'secret_token',
'/next_url',
)
self.assertEqual(login.current_user.username, 'test_screen_name')
- self.assertEqual(login.current_user.is_authenticated(), True)
+ self.assertEqual(login.current_user.is_authenticated, True)