I'm using devise for an english/french application and have been translating the different views. On devise/passwords/new.html.erb I have a message that appears when a "wrong" email address is entered and the "Send me reset password instructions" button is pressed.
I get the following message if there is an # missing:
A picture of the message
There a different message if there is a # with nothing following, or a # with nothing before.
This message or even type of message doesn't seem to appear elsewhere, which is odd. It doesn't seem to be defined in the following files:
en.yml: github.com/plataformatec/devise/blob/master/config/locales/en.yml
devise_helper.rb: github.com/plataformatec/devise/blob/master/app/helpers/devise_helper.rb
validatable.rb: github.com/plataformatec/devise/blob/master/lib/devise/models/validatable.rb
I think the backend of the message is linked to the regex validating emails and I have no idea where the frontend comes from (keep in mind I'm a bit new to all this). If I can't translate the message, I'd like at least to be able to desactivate this message.
I have done a bit more research and the error message you are receiving seems to be triggered by the browser (you are probably using Chrome). In other words, Devise has nothing to do with it.
The email_field helper probably causes client-side validation from the browser. One option would be to use classic field helpers, such as text_field, or you can add novalidate to prevent client-side validation from the browser. In the last case you should add some own validation if you want some restrictions.
Personally I like simple_form a lot, this is how this problem is countered in simple_form: https://github.com/plataformatec/simple_form/wiki/HTML5-Attributes
Or for a html example: http://www.w3.org/TR/html5/forms.html#concept-fs-novalidate
Related
I am working on a bulk mailing platform using Django send_mass_mail function. Everything worked perfectly. But the problem I am facing is, I have nearly 500 recipients, and if one recipient fails to receive mail (recipient side errors like, improper mail address provision), the whole function stops immediately. How to send the next mail, if current data tuple has errors in data. I think the question is straight and need no code examples. Since i followed straight from the Django Docs
According to the docs you could use fail_silently=True (which is False by default):
fail_silently: A boolean. When it’s False, send_mail() will raise an smtplib.SMTPException if an error occurs. See the smtplib docs for a list of possible exceptions, all of which are subclasses of SMTPException.
I've searched and searched and the usual response seems to be "set debug and template_debug to True".
However.
I'm generating mails for notification purposes and I have a small class that handles the template rendering as well are the creation of the EmailMessage object afterwards(for DRY reasons in regards to html content etc).
The thing is that I would like to log any rendering errors so that I can analyze them elsewhere. There's a lot of different mails to be sent out with a lot of different variables based on dates, memberships, permissions etc. And I would like to know if a variable was missing while rendering..
Right now I have to regularly check Mandrill (where they store the content of mails for up to 30 days) so see if all mails have all the relevant data..
I know I could go the unit test way - but that seems a bit much when all I wan't to do is to catch any errors unobtrusively.
What do you think? Am I way off in how this could be handled??
My app is rather barebones right now, so it might be a very stupid mistake by my side. I'm testing with cucumber signing out with devise
Scenario: User signs out
Given I am logged in
When I sign out
Then I should see a signed out message
Everything is pretty standard, I've set devise to accept get requests for signing out, and from my logs everything appears to work as expected. Only problem is the last step, the flash/notice message doesn't show up, which is very weird (as always with devise, I don't know who's setting what and where...).
This is my layout view:
%body
- unless notice.blank?
%p.notice= notice
- unless alert.blank?
%p.alert= alert
= yield
What I see is a completely blank page... I've already checked locales, the message is there. The sign_out call is the standard one. Flash messages appear to be completely empty (blank).
What course of action would you suggest I take in order to debug this?
I am using Django Postman for the intercommunication between two user of my django website .
But when i am sending a message to another user .It is not delivered to the recepient .
I shows me as sent message .In http://127.0.0.1:8000/messages/sent
Here is settings.py setting
############################# Django postman
POSTMAN_AUTO_MODERATE_AS = True
POSTMAN_SHOW_USER_AS = True
POSTMAN_NOTIFIER_APP = True
###################################
And once the messages is sent it is storing properly in the Dtabase but it is not appearing to the recepient inbox.
Please tell me what might I am doing wrong here .
I encountered seemingly identical problem, in my case cause was default moderation.
To better diagnose if this is the case, you can:
check your 'invisible' messages in database, for example using phpmyadmin. If there's 'p' as m moderation_status or anything suspicious under moderation_... columns, this track is probably good;
dig into code: locate postman/models.py and experiment with class MessageManager, method inbox (since other message directories are fine, this one is suspicious). Any of filters there might be cause of your problem - for me it was obviously 'moderation_status'. Even if your case is different, this is good starting point for further debugging.
Use case: let's assume moderation issues
I see that you have
POSTMAN_AUTO_MODERATE_AS = True
set, but perhaps you have left moderation function somewhere, or something gets overwritten in your configuration? Postman's Quick Start Guide indicates that both are necessary:
To disable the moderation feature (no control, no filter):
Set this option to True
Do not provide any auto-moderation functions
I'd suggest removing all other postman specific options from your settings.py, leaving only POSTMAN_AUTO_MODERATE_AS = True and check if there are any utility functions that could potentially interfere with Message objects.
For further reference, more information about moderation is here: https://bitbucket.org/psam/django-postman/wiki/Moderation
On very rate occasions, my error log is showing the following error:
"You specified a Fuseaction of registrationaction#close which is not defined in Circuit public."
The full link is:"http://myUrl/index.cfm?do=public.registrationAction#close"
As you can see, the has merely points to an anchor (close) on the page.
This code is working 99% of the time, but on the odd occasion, Coldfusion / Fusebox throws this error out.
Why is this happening?
Could it be related to the device accessing my page somehow? Like a cell phone or Apple product that for some reason does handle hashes the way I am expecting it to?
Could it be javascript / JQuery being disabled?
Any guidance would be appreciated
Thanks
I used to see stuff like that. Older versions of Internet Explorer were not handling the hashtag properly when there were URL parameters. The best solution I could come up with was kludgey at best, but basically it forced the anchor tag to separate from the URL parameter.
http://myUrl/index.cfm?do=public.registrationAction&#close
I'm not sure there is a simple answer to this. We get odd exceptions all the time on our site for all sorts of reasons. Sometimes it's people not using the site the way you expect and sometimes it stuff like you mention such as user-agent edge cases etc.
Basically you need to start to gather evidence and see what comes up that's unusual with these requests.
So to start: do you catch exceptions in you application? If so dumping all scopes (CGI/CLIENT/FORM/URL/SESSION) in an email along with the full exception and emailing them to a custom emails address (such as errors#yourdomain.com) will give you a reference you can square up to your error times and this might give you a hint as to the real issue.
Hope that helps some!