Fixed bug that allowed addcom to set the same alias to two different channels.
/Griatch
This commit is contained in:
parent
35676b7660
commit
6d45c98b8e
1 changed files with 13 additions and 2 deletions
|
|
@ -44,6 +44,17 @@ def cmd_addcom(command):
|
||||||
try:
|
try:
|
||||||
chan = CommChannel.objects.get(name__iexact=chan_name)
|
chan = CommChannel.objects.get(name__iexact=chan_name)
|
||||||
s = ""
|
s = ""
|
||||||
|
|
||||||
|
#if we happened to have this alias already defined on another channel, make
|
||||||
|
#sure to tell us.
|
||||||
|
aliasmatch = [cmatch.channel.name for cmatch in
|
||||||
|
source_object.channel_membership_set.filter(user_alias=chan_alias)
|
||||||
|
if cmatch.channel.name != chan_name]
|
||||||
|
if aliasmatch:
|
||||||
|
s = "The alias '%s' is already in use (for channel '%s')." % (chan_alias, aliasmatch[0])
|
||||||
|
source_object.emit_to(s)
|
||||||
|
return
|
||||||
|
|
||||||
if membership:
|
if membership:
|
||||||
#we are already members of this channel. Set a different alias.
|
#we are already members of this channel. Set a different alias.
|
||||||
# Note: To this without requiring a the user to logout then login again,
|
# Note: To this without requiring a the user to logout then login again,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue