aboutsummaryrefslogtreecommitdiff
path: root/pyaggr3g470r/views.py
diff options
context:
space:
mode:
authorCédric Bonhomme <cedric@cedricbonhomme.org>2014-10-01 08:00:43 +0200
committerCédric Bonhomme <cedric@cedricbonhomme.org>2014-10-01 08:00:43 +0200
commit639dffb7d27cc49684a6cb2a8ad57b936b1e01dc (patch)
tree1a11bc1ea366bb9eb2df2af82e3e394e4bfcbb04 /pyaggr3g470r/views.py
parentRelease 5.6.6. (diff)
downloadnewspipe-639dffb7d27cc49684a6cb2a8ad57b936b1e01dc.tar.gz
newspipe-639dffb7d27cc49684a6cb2a8ad57b936b1e01dc.tar.bz2
newspipe-639dffb7d27cc49684a6cb2a8ad57b936b1e01dc.zip
Python 3 support
Diffstat (limited to 'pyaggr3g470r/views.py')
-rw-r--r--pyaggr3g470r/views.py18
1 files changed, 8 insertions, 10 deletions
diff --git a/pyaggr3g470r/views.py b/pyaggr3g470r/views.py
index 6e8b35d2..cf50dae3 100644
--- a/pyaggr3g470r/views.py
+++ b/pyaggr3g470r/views.py
@@ -42,16 +42,15 @@ from sqlalchemy.exc import IntegrityError
from werkzeug import generate_password_hash
import conf
-import utils
-import export
-import emails
-if not conf.ON_HEROKU:
- import search as fastsearch
-from forms import SignupForm, SigninForm, AddFeedForm, \
- ProfileForm, InformationMessageForm, RecoverPasswordForm
+from pyaggr3g470r import utils, emails, export
from pyaggr3g470r import app, db, allowed_file, babel
from pyaggr3g470r.models import User, Feed, Article, Role
from pyaggr3g470r.decorators import feed_access_required
+from pyaggr3g470r.forms import SignupForm, SigninForm, AddFeedForm, \
+ ProfileForm, InformationMessageForm, RecoverPasswordForm
+if not conf.ON_HEROKU:
+ import pyaggr3g470r.search as fastsearch
+
Principal(app)
# Create a permission with a single Need, in this case a RoleNeed.
@@ -914,9 +913,8 @@ def disable_user(user_id=None):
flash(gettext('Problem while sending activation email') + ': ' + str(e), 'danger')
else:
- import random, base64, hashlib
- user.activation_key = base64.b64encode(hashlib.sha512( str(random.getrandbits(256)) ).digest(),
- random.choice(['rA','aZ','gQ','hH','hG','aR','DD'])).rstrip('==')
+ import random, hashlib
+ user.activation_key = hashlib.sha512(str(random.getrandbits(256)).encode("utf-8")).hexdigest()
flash(gettext('Account of the user') + ' ' + user.nickname + ' ' + gettext('successfully disabled.'), 'success')
db.session.commit()
else:
bgstack15