Commits

Scott Nixon committed 4d9b83f Draft

Fixed unicode search issues and invalid email address being added to mailchimp.

  • Participants
  • Parent commits 5a53bb2

Comments (0)

Files changed (3)

     class Media:
         js = (
             '//happyherb-photos.s3.amazonaws.com/admin/grappelli/jquery/jquery-1.6.2.min.js',
-            '//photos.happyherbivore.com/admin/redactor/802/redactor.min.js',
-            '//photos.happyherbivore.com/admin/redactor/redactor_init.js',
+            '//photos.happyherbivore.com/admin/redactor/redactor-802v1.js',
+            '//photos.happyherbivore.com/admin/redactor/redactor_init-v2.js',
             )
         css = {
             "all" : ('//photos.happyherbivore.com/admin/redactor/802/redactor.css',
     class Media:
         js = (
             '//happyherb-photos.s3.amazonaws.com/admin/grappelli/jquery/jquery-1.6.2.min.js',
-            '//photos.happyherbivore.com/admin/redactor/802/redactor.min.js',
-            '//photos.happyherbivore.com/admin/redactor/redactor_init.js',
+            '//photos.happyherbivore.com/admin/redactor/redactor-802v1.js',
+            '//photos.happyherbivore.com/admin/redactor/redactor_init-v2.js',
             )
         css = {
             "all" : ('//photos.happyherbivore.com/admin/redactor/802/redactor.css',
     class Media:
         js = (
             '//happyherb-photos.s3.amazonaws.com/admin/grappelli/jquery/jquery-1.6.2.min.js',
-            '//photos.happyherbivore.com/admin/redactor/802/redactor.min.js',
-            '//photos.happyherbivore.com/admin/redactor/redactor_init.js',
+            '//photos.happyherbivore.com/admin/redactor/redactor-802v1.js',
+            '//photos.happyherbivore.com/admin/redactor/redactor_init-v2.js',
             )
         css = {
             "all" : ('//photos.happyherbivore.com/admin/redactor/802/redactor.css',
 from django.views.generic.dates import ArchiveIndexView, MonthArchiveView # YearArchiveView
 from django.views.generic.base import TemplateView
 
-from models import Post
-from views import YearArchiveView
+from article.models import Post
+from article.views import YearArchiveView
 
 post_info_dict = {
     'queryset': Post.active.filter(is_published=1,post_type=1),
+from __future__ import unicode_literals
+import re
 from datetime import datetime
 
 from django.conf import settings
                     post[i]
                 except KeyError:
                     continue
-                result = ms.listSubscribe(id=mc_id[i], email_address=post['EMAIL'])
+                if post.get('EMAIL') and re.match("^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$", post.get('EMAIL')) != None:
+                    result = ms.listSubscribe(id=mc_id[i], email_address=post.get('EMAIL'))
+                else:
+                    return HttpResponse("Please enter a real email address.")
             return HttpResponse("<div class='alert-message success'><a onclick=\"$('.alert-message').hide();\" class='close'>x</a><p><strong>Well done!</strong> To complete the subscription process, please click the link in the email we just sent you.</p></div>")
         else:
             return HttpResponse("Our email provider is current experience technical difficulties.")