mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-23 10:34:19 +01:00
Added one minor thing so *all* unexpired news items aren't shown.
This commit is contained in:
parent
5be65f1caf
commit
b6fb71d5a5
@ -262,7 +262,7 @@ class News(plugins.ChannelDBHandler, callbacks.Privmsg):
|
||||
irc.reply(msg, '%s: %s' % (cursor, item))
|
||||
else:
|
||||
cursor.execute("""SELECT id, subject FROM news
|
||||
WHERE expires_at < %s
|
||||
WHERE expires_at <> 0 AND expires_at < %s
|
||||
ORDER BY id DESC""", int(time.time()))
|
||||
if cursor.rowcount == 0:
|
||||
irc.error(msg, 'I have no news for that channel.')
|
||||
|
@ -75,6 +75,8 @@ if sqlite is not None:
|
||||
self.assertRegexp('news 1', 'baz')
|
||||
|
||||
def testOldnews(self):
|
||||
self.assertError('oldnews')
|
||||
self.assertNotError('addnews 0 a: b')
|
||||
self.assertError('oldnews')
|
||||
self.assertNotError('addnews 5 foo: bar')
|
||||
self.assertError('oldnews')
|
||||
|
Loading…
Reference in New Issue
Block a user