def is_valid(self):
valid = super(RegistrationContactForm,self).is_valid()<EOL>msgs = messages.get_messages(self._request)<EOL>prior_messages = self._session.pop('<STR_LIT>',[])<EOL>remaining_messages = []<EOL>for m in msgs:<EOL><INDENT>m_dict = {'<STR_LIT:message>': m.message, '<STR_LIT>': m.level, '<STR_LIT>': m.extra_tags}<EOL>if m_dict not in prior_messages:<EOL><INDENT>remaining_messages.append(m_dict)<EOL><DEDENT><DEDENT>if remaining_messages:<EOL><INDENT>self._session['<STR_LIT>'] = remaining_messages<EOL>self._request.session.modified = True<EOL>return False<EOL><DEDENT>return valid<EOL>
For this form to be considered valid, there must be not only no errors, but also no messages on
the request that need to be shown.