diff options
Diffstat (limited to 'pyaggr3g470r')
-rw-r--r-- | pyaggr3g470r/export.py | 1 | ||||
-rw-r--r-- | pyaggr3g470r/forms.py | 1 | ||||
-rw-r--r-- | pyaggr3g470r/models/feed.py | 1 | ||||
-rw-r--r-- | pyaggr3g470r/notifications.py | 11 | ||||
-rw-r--r-- | pyaggr3g470r/templates/edit_feed.html | 5 | ||||
-rwxr-xr-x | pyaggr3g470r/utils.py | 7 | ||||
-rw-r--r-- | pyaggr3g470r/views/api/feed.py | 1 | ||||
-rw-r--r-- | pyaggr3g470r/views/views.py | 3 |
8 files changed, 4 insertions, 26 deletions
diff --git a/pyaggr3g470r/export.py b/pyaggr3g470r/export.py index f60bb3a9..5f54a0c1 100644 --- a/pyaggr3g470r/export.py +++ b/pyaggr3g470r/export.py @@ -212,7 +212,6 @@ def export_json(user): "description": feed.description, "link": feed.link, "site_link": feed.site_link, - "email_notification": feed.email_notification, "enabled": feed.enabled, "created_date": feed.created_date.strftime('%s'), "articles": [ { diff --git a/pyaggr3g470r/forms.py b/pyaggr3g470r/forms.py index 3e987082..58abb864 100644 --- a/pyaggr3g470r/forms.py +++ b/pyaggr3g470r/forms.py @@ -83,7 +83,6 @@ class AddFeedForm(Form): title = TextField(lazy_gettext("Title"), [validators.Optional()]) link = TextField(lazy_gettext("Feed link"), [validators.Optional()]) site_link = TextField(lazy_gettext("Site link")) - email_notification = BooleanField(lazy_gettext("Email notification"), default=False) enabled = BooleanField(lazy_gettext("Check for updates"), default=True) submit = SubmitField(lazy_gettext("Save")) diff --git a/pyaggr3g470r/models/feed.py b/pyaggr3g470r/models/feed.py index 176f0f01..28cb2b92 100644 --- a/pyaggr3g470r/models/feed.py +++ b/pyaggr3g470r/models/feed.py @@ -42,7 +42,6 @@ class Feed(db.Model): description = db.Column(db.String(), default="FR") link = db.Column(db.String()) site_link = db.Column(db.String(), default="") - email_notification = db.Column(db.Boolean(), default=False) enabled = db.Column(db.Boolean(), default=True) created_date = db.Column(db.DateTime(), default=datetime.now) diff --git a/pyaggr3g470r/notifications.py b/pyaggr3g470r/notifications.py index e351573c..cf8fb723 100644 --- a/pyaggr3g470r/notifications.py +++ b/pyaggr3g470r/notifications.py @@ -20,7 +20,6 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. import conf -from pyaggr3g470r import utils from pyaggr3g470r import emails @@ -60,13 +59,3 @@ def new_password_notification(user, password): (password, ) plaintext += "\n\nIt is advised to replace it as soon as connected to pyAggr3g470r.\n\nSee you," emails.send(to=user.email, bcc=conf.NOTIFICATION_EMAIL, subject="[pyAggr3g470r] New password", plaintext=plaintext) - -def new_article_notification(user, feed, article): - """ - New article notification. - """ - subject = '[pyAggr3g470r] ' + feed.title + ": " + article.title - html = """<html>\n<head>\n<title>%s</title>\n</head>\n<body>\n%s\n</body>\n</html>""" % \ - (feed.title + ": " + article.title, article.content) - plaintext = utils.clear_string(html) - emails.send(to=user.email, bcc=conf.NOTIFICATION_EMAIL, subject=subject, plaintext=plaintext, html=html) diff --git a/pyaggr3g470r/templates/edit_feed.html b/pyaggr3g470r/templates/edit_feed.html index f1a61b89..1238e257 100644 --- a/pyaggr3g470r/templates/edit_feed.html +++ b/pyaggr3g470r/templates/edit_feed.html @@ -15,11 +15,6 @@ {{ form.site_link.label }} {{ form.site_link(class_="form-control", placeholder="Optional") }} {% for error in form.site_link.errors %} <span style="color: red;">{{ error }}<br /></span>{% endfor %} - {% if not_on_heroku %} - {{ form.email_notification.label }} - {{ form.email_notification(class_="checkbox") }} - {% endif %} - {{ form.enabled.label }} {{ form.enabled(class_="checkbox") }} diff --git a/pyaggr3g470r/utils.py b/pyaggr3g470r/utils.py index 01bcd36c..1fc84ff4 100755 --- a/pyaggr3g470r/utils.py +++ b/pyaggr3g470r/utils.py @@ -30,8 +30,7 @@ __license__ = "AGPLv3" # This file provides functions used for: # - the database management; # - generation of tags cloud; -# - HTML processing; -# - e-mail notifications. +# - HTML processing. # import re @@ -130,7 +129,7 @@ def import_opml(email, opml_content): new_feed = Feed(title=title, description=description, link=link, site_link=site_link, - email_notification=False, enabled=True) + enabled=True) user.feeds.append(new_feed) nb += 1 @@ -155,7 +154,7 @@ def import_json(email, json_content): continue new_feed = Feed(title=feed["title"], description="", link=feed["link"], \ - site_link=feed["site_link"], email_notification=feed["email_notification"], \ + site_link=feed["site_link"], \ created_date=datetime.datetime.fromtimestamp(int(feed["created_date"])), enabled=feed["enabled"]) user.feeds.append(new_feed) diff --git a/pyaggr3g470r/views/api/feed.py b/pyaggr3g470r/views/api/feed.py index 625ad52d..898e30b0 100644 --- a/pyaggr3g470r/views/api/feed.py +++ b/pyaggr3g470r/views/api/feed.py @@ -13,7 +13,6 @@ FEED_ATTRS = {'title': {'type': str}, 'description': {'type': str}, 'link': {'type': str}, 'site_link': {'type': str}, - 'email_notification': {'type': bool, 'default': False}, 'enabled': {'type': bool, 'default': True}, 'etag': {'type': str, 'default': ''}, 'last_modified': {'type': str}, diff --git a/pyaggr3g470r/views/views.py b/pyaggr3g470r/views/views.py index 0f8fc04d..d42d5db8 100644 --- a/pyaggr3g470r/views/views.py +++ b/pyaggr3g470r/views/views.py @@ -571,8 +571,7 @@ def edit_feed(feed_id=None): existing_feed = [f for f in g.user.feeds if feed.link == form.link.data] if len(existing_feed) == 0: new_feed = Feed(title=form.title.data, description="", link=form.link.data, \ - site_link=form.site_link.data, email_notification=form.email_notification.data, \ - enabled=form.enabled.data) + site_link=form.site_link.data, enabled=form.enabled.data) g.user.feeds.append(new_feed) #user.feeds = sorted(user.feeds, key=lambda t: t.title.lower()) db.session.commit() |