Commits

masklinn committed 2a62fb6

Modules -> Blueprints, since modules are deprecated since Flask 0.8

  • Participants
  • Parent commits 16dc743

Comments (0)

Files changed (4)

File sphinxweb/__init__.py

     db_session.remove()
     return response
 
-from sphinxweb.views.docs import docs
-from sphinxweb.views.auth import auth
-app.register_module(docs)
-app.register_module(auth)
+from sphinxweb.views import docs, auth
+app.register_blueprint(docs.docs)
+app.register_blueprint(auth.auth)

File sphinxweb/templates/login.html

   <p>
   {%- for name, icon, url in oid_providers %}
   <a href="{{ url }}" class="oid">
-    <img src="{{ url_for('.static', filename='oid/' + icon) }}" alt="{{ name }}" />
+    <img src="{{ url_for('static', filename='oid/' + icon) }}" alt="{{ name }}" />
   </a>
   {%- endfor %}
   </p>

File sphinxweb/views/auth.py

     :license: BSD, see LICENSE for details.
 """
 
-from flask import Module, g, request, render_template, session, flash, \
+from flask import Blueprint, g, request, render_template, session, flash, \
     redirect, url_for, abort
 
 from flask.ext.openid import OpenID
 from sphinxweb import support
 from sphinxweb.models import User, db_session
 
-auth = Module(__name__)
+auth = Blueprint('auth', __name__)
 
 # setup flask-openid
 oid = OpenID()
         flash(u'Successfully logged in.')
         g.user = user
         return redirect(oid.get_next_url())
-    return redirect(url_for('create_profile', next=oid.get_next_url(),
+    return redirect(url_for('.create_profile', next=oid.get_next_url(),
                             name=resp.fullname or resp.nickname,
                             email=resp.email))
 
                 flash(u'Error: user name or email address already taken.')
             else:
                 flash(u'Profile successfully updated.')
-                return redirect(url_for('edit_profile'))
+                return redirect(url_for('.edit_profile'))
     return render_template('edit_profile.html', form=form,
                            openid=session['openid'])
 

File sphinxweb/views/docs.py

     :license: BSD, see LICENSE for details.
 """
 
-from flask import Module, render_template, request, g, abort, jsonify
+from flask import Blueprint, render_template, request, g, abort, jsonify
 from sphinx.websupport.errors import UserNotAuthorizedError, \
      DocumentNotFoundError
 
 from sphinxweb import support
 
-docs = Module(__name__)
+docs = Blueprint('docs', __name__)
 
 @docs.route('/')
 def index():