Browse Source

fix "IntegrityError: mumble_mumble.player may not be NULL". (I've been able to reproduce it at last.)

Natenom/support-murmur-13-1446181288462
Michael Ziegler 15 years ago
parent
commit
39271700ce
  1. 11
      pyweb/mumble/models.py

11
pyweb/mumble/models.py

@ -215,13 +215,16 @@ class Mumble( models.Model ):
self.sslkey = find_in_dicts( "key" ); self.sslkey = find_in_dicts( "key" );
self.obfsc = bool( find_in_dicts( 'obfuscate' ) ); self.obfsc = bool( find_in_dicts( 'obfuscate' ) );
pldefault = self._meta.get_field_by_name('player')[0].default;
if self.ctl.getVersion()[:2] == ( 1, 2 ): if self.ctl.getVersion()[:2] == ( 1, 2 ):
self.player = find_in_dicts( ( 'username', 'playername' ) );
self.player = find_in_dicts( ( 'username', 'playername' ), pldefault );
else: else:
self.player = find_in_dicts( 'playername' );
self.player = find_in_dicts( 'playername', pldefault );
self.channel = find_in_dicts( 'channelname' );
self.defchan = int( find_in_dicts( 'defaultchannel' ) );
chdefault = self._meta.get_field_by_name('channel')[0].default;
self.channel = find_in_dicts( 'channelname', chdefault );
self.defchan = int( find_in_dicts( 'defaultchannel', 0 ) );
self.booted = ( self.srvid in self.ctl.getBootedServers() ); self.booted = ( self.srvid in self.ctl.getBootedServers() );
self.save( dontConfigureMurmur=True ); self.save( dontConfigureMurmur=True );

Loading…
Cancel
Save