changeset 92:0c3e35a8b5ed draft

bugs: add more docstrings
author diegoe-guest
date Wed, 01 Jul 2009 07:39:59 +0000
parents 4dd377ff0df5
children 3a421b779396
files bts_webui/amancay/bugs.py
diffstat 1 files changed, 16 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/bts_webui/amancay/bugs.py
+++ b/bts_webui/amancay/bugs.py
@@ -27,6 +27,13 @@
 from smtplib import SMTPRecipientsRefused
 
 def bug(request, bug_number):
+	"""
+	Renders a bug page.
+
+	If the given bug page has been reached as a result of a POST action, the
+	data sent will be processed by process_bug_post and the bug will be
+	rendered after that to the user.
+	"""
 	# Process post
 	info = process_bug_post(request, bug_number)
 
@@ -96,7 +103,7 @@
 
 def process_bug_post(request, bug_number):
 	"""
-	Function to process the different forms that are there.
+	Process the different forms based on presence of some fields.
 	"""
 	if request.POST.has_key('subject') or request.POST.has_key('comment'):
 		return add_comment(request, bug_number)
@@ -211,6 +218,10 @@
 	return handle_email(request, to_address, '', '')
 
 def handle_email(request, to_address, subject, text):
+	"""
+	Sends an email to to_address if the user is authenticated, otherwise it
+	saves it in queue.
+	"""
 	user = request.user
 	if user.is_authenticated():
 		send_mail(subject, text, user.email, to_address)
@@ -256,6 +267,10 @@
 	send_mail(subject, message, settings.DEFAULT_FROM_EMAIL, [from_address])
 
 def activate_message(request, activation_key):
+	"""
+	Flushes emails in the message queue corresponding to a given
+	activation_key.
+	"""
 	# Make sure the key we're trying conforms to the pattern of a
 	# SHA1 hash; if it doesn't, no point even trying to look it up
 	# in the DB.