Commits

tehfink committed a14a7fc

hopefully fixes: "AttributeError: 'module' object has no attribute 'url_re'"

Comments (0)

Files changed (1)

byteflow/apps/discussion/forms.py

         if url:
             if not (url.startswith('http://') or url.startswith('https://')):
                 url = 'http://%s' % url
-            if not forms.fields.url_re.search(url):
+            try:
+                if not forms.fields.url_re.search(url):
+                    raise Exception
+            except (Exception, AttributeError), e:
                 raise forms.ValidationError(u'Please ensure your URL is a full web address (eg: http://google.com/)')
-            return url
+            finally:
+                return url
 
     def save(self):
         try: