empty flash messages
See original GitHub issuehi,
I would like to make use of keystone’s flash messages, however the displayed messages end up empty:
// what file is this? routes/views/index.js ? - Harry Moreno
var keystone = require('keystone');
exports = module.exports = function(req, res) {
var view = new keystone.View(req, res);
var locals = res.locals;
locals.section = 'forum';
view.on('init', function(next) {
keystone.list('ForumThread').model
.findOne({'slug': req.params.slug})
.exec(function(err, result) {
if (err) { return next(err); }
if (!result) {
req.flash('warning', 'Thread not found.');
} else {
locals.thread = result;
}
next();
});
});
view.render('thread');
};
any idea what’s going wrong here?
thanks a lot in advance.
Issue Analytics
- State:
- Created 9 years ago
- Comments:16 (6 by maintainers)
Top Results From Across the Web
how to clear existing flash messages in Flask - Stack Overflow
This way you can clear the flash message as there is no predefined method to clear the flash message in Flask flash helpers....
Read more >Empty Flash Messages - Apple Support Communities
I've been getting these empty Flash messages on my iphone 11 and I can't seem to find the reason for it. Anyone has...
Read more >10. Message Flashing — Flask API - GitHub Pages
10. Message Flashing¶ ... Flashes a message to the next request. In order to remove the flashed message from the session and to...
Read more >Message Flashing — Flask Documentation (2.2.x)
The flashing system basically makes it possible to record a message at the end of a request and access it next request and...
Read more >How To Use Messages With Flask - Flask Fridays #6 - YouTube
We'll also look at using Bootstrap to style the flash messages, and make them delete -able and fade-able. Timecodes 0:00 - Introduction 1:04 ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
If you use the object format, does the error display on
/keystone/signin
, or can you only achieve one or the other?req.flash('error', { detail: 'You cannot access that page.' });
I wasn’t involved when any of these decisions was taken, so I can’t really comment. @JedWatson?