Mercurial > public > sg101
comparison gpp/bio/models.py @ 363:9d470c7a2b93
Following up on #168; redo some code to make it more DRY. Added a function on the profile to reset the text fields.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Sat, 05 Mar 2011 04:03:30 +0000 |
parents | 000c006fee97 |
children | e0523e17ea43 |
comparison
equal
deleted
inserted
replaced
362:c5ae0a276e33 | 363:9d470c7a2b93 |
---|---|
124 """ | 124 """ |
125 return self.user.is_active | 125 return self.user.is_active |
126 user_is_active.boolean = True | 126 user_is_active.boolean = True |
127 user_is_active.short_description = "Is Active" | 127 user_is_active.short_description = "Is Active" |
128 | 128 |
129 def reset_text_fields(self): | |
130 """ | |
131 Reset profile text fields to empty defaults. | |
132 This function is useful when a spammer is identified. | |
133 | |
134 """ | |
135 self.location = '' | |
136 self.occupation = '' | |
137 self.interests = '' | |
138 self.profile_text = '' | |
139 self.signature = '' | |
140 | |
129 def search_title(self): | 141 def search_title(self): |
130 full_name = self.user.get_full_name() | 142 full_name = self.user.get_full_name() |
131 if full_name: | 143 if full_name: |
132 return u"%s (%s)" % (self.user.username, full_name) | 144 return u"%s (%s)" % (self.user.username, full_name) |
133 return self.user.username | 145 return self.user.username |