diff 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
line wrap: on
line diff
--- a/gpp/bio/models.py	Sat Mar 05 03:43:32 2011 +0000
+++ b/gpp/bio/models.py	Sat Mar 05 04:03:30 2011 +0000
@@ -126,6 +126,18 @@
     user_is_active.boolean = True
     user_is_active.short_description = "Is Active"
 
+    def reset_text_fields(self):
+        """
+        Reset profile text fields to empty defaults.
+        This function is useful when a spammer is identified.
+
+        """
+        self.location = ''
+        self.occupation = ''
+        self.interests = ''
+        self.profile_text = ''
+        self.signature = ''
+
     def search_title(self):
         full_name = self.user.get_full_name()
         if full_name: