~bnrubin/bantrackertwo/devel

« back to all changes in this revision

Viewing changes to bt/models.py

  • Committer: Benjamin Rubin
  • Date: 2009-11-26 19:12:47 UTC
  • Revision ID: bnrubin@romulus-20091126191247-xd19zre39wx3drvu
- More changes for bot compatability

Show diffs side-by-side

added added

removed removed

Lines of Context:
103
103
    user = models.ForeignKey(User, null = True)
104
104
    host = models.CharField(max_length=255, null = True)
105
105
    def __unicode__(self):
106
 
        if self.host:
107
 
            return self.host
 
106
        if self.user:
 
107
            return self.user.userprofile_set.get().nickname
108
108
        else:
109
 
            return ''
 
109
            return self.host.split('!')[0]
110
110
            
111
111
def user_post_save(sender, instance, **kwargs):
112
112
    # This automatically adds our UserProfile to newly created or saved Users