Browse Source

prevented "server" field on MumbleUser model from being changed once the record has been entered into the database (and hence into murmur). fixes #2

Natenom/support-murmur-13-1446181288462
Michael Ziegler 16 years ago
parent
commit
76d66448fc
  1. 5
      pyweb/mumble/models.py

5
pyweb/mumble/models.py

@ -272,7 +272,12 @@ class MumbleUser( models.Model ):
murmur = self.server.getDbusObject(); murmur = self.server.getDbusObject();
murmur.unregisterPlayer( dbus.Int32( self.mumbleid ) ); murmur.unregisterPlayer( dbus.Int32( self.mumbleid ) );
def __setattr__( self, name, value ):
if name == 'server':
if self.id is not None and self.server != value:
raise AttributeError( "This field must not be updated once the Record has been saved." );
models.Model.__setattr__( self, name, value );
from django.db.models import signals from django.db.models import signals

Loading…
Cancel
Save