* Found all my stupid bugs, and remembered that django's Model#get() will raise an exception if it cannot find any matching objects. Used that to determine "no such user".
This commit is contained in:
parent
21a03fc07c
commit
6355ed2298
1 changed files with 8 additions and 13 deletions
|
|
@ -247,19 +247,14 @@ def cmd_page(cdat):
|
||||||
cdat['uinput']['splitted'].pop(0)
|
cdat['uinput']['splitted'].pop(0)
|
||||||
target_name = cdat['uinput']['splitted'].pop(0)
|
target_name = cdat['uinput']['splitted'].pop(0)
|
||||||
message = ' '.join(cdat['uinput']['splitted'])
|
message = ' '.join(cdat['uinput']['splitted'])
|
||||||
target = Object.objects.get(name__iexact=target_name)
|
try:
|
||||||
if target:
|
target = Object.objects.get(name__iexact=target_name)
|
||||||
session.msg("Found user %s.", (target.get_name(),))
|
if target.is_connected_plr():
|
||||||
try:
|
target.emit_to("%s pages you with: %s" % (session.get_pobject().get_name(), message))
|
||||||
if target.is_connected_plr():
|
session.msg("Page sent.")
|
||||||
target.emit_to("% pages you with: %s" %
|
else:
|
||||||
(session.get_pobject().name.capitalize(), message))
|
session.msg("User %s is not logged on." % (target_name.capitalize(),))
|
||||||
session.msg("Page sent.")
|
except:
|
||||||
else:
|
|
||||||
session.msg("User %s is not logged on." % (target_name.capitalize(),))
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
else:
|
|
||||||
session.msg("User %s not found." % (target_name,))
|
session.msg("User %s not found." % (target_name,))
|
||||||
|
|
||||||
def cmd_quit(cdat):
|
def cmd_quit(cdat):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue