mirror of https://github.com/Mikaela/Limnoria.git
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))
|
irc.reply(msg, '%s: %s' % (cursor, item))
|
||||||
else:
|
else:
|
||||||
cursor.execute("""SELECT id, subject FROM news
|
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()))
|
ORDER BY id DESC""", int(time.time()))
|
||||||
if cursor.rowcount == 0:
|
if cursor.rowcount == 0:
|
||||||
irc.error(msg, 'I have no news for that channel.')
|
irc.error(msg, 'I have no news for that channel.')
|
||||||
|
|
|
@ -75,6 +75,8 @@ if sqlite is not None:
|
||||||
self.assertRegexp('news 1', 'baz')
|
self.assertRegexp('news 1', 'baz')
|
||||||
|
|
||||||
def testOldnews(self):
|
def testOldnews(self):
|
||||||
|
self.assertError('oldnews')
|
||||||
|
self.assertNotError('addnews 0 a: b')
|
||||||
self.assertError('oldnews')
|
self.assertError('oldnews')
|
||||||
self.assertNotError('addnews 5 foo: bar')
|
self.assertNotError('addnews 5 foo: bar')
|
||||||
self.assertError('oldnews')
|
self.assertError('oldnews')
|
||||||
|
|
Loading…
Reference in New Issue