summaryrefslogtreecommitdiff
path: root/website
diff options
context:
space:
mode:
authorholyantony2015-05-08 11:59:21 +0530
committerholyantony2015-05-08 11:59:21 +0530
commitf691ef58933bf33033389a1a468f655af19c1e16 (patch)
tree44d9812876286b2a855af4673c2f620e671a35af /website
parent20998fcb52d55b25da2f63965c98e7b171d4f1ed (diff)
downloadFOSSEE-Forum-f691ef58933bf33033389a1a468f655af19c1e16.tar.gz
FOSSEE-Forum-f691ef58933bf33033389a1a468f655af19c1e16.tar.bz2
FOSSEE-Forum-f691ef58933bf33033389a1a468f655af19c1e16.zip
Subject: Profile updation and Email notification
Description: 1. Confirmation link on registration via email 2. Profile updation on registration confirmation 3. Email notification posting question and answer
Diffstat (limited to 'website')
-rw-r--r--website/models.py12
-rw-r--r--website/views.py5
2 files changed, 15 insertions, 2 deletions
diff --git a/website/models.py b/website/models.py
index da87cb5..c7e43aa 100644
--- a/website/models.py
+++ b/website/models.py
@@ -3,7 +3,7 @@ from django.db import models
from django.contrib.auth.models import User
from django.contrib.auth import get_user_model
-User = get_user_model()
+
class FossCategory(models.Model):
name = models.CharField(max_length=100)
@@ -85,3 +85,13 @@ class Notification(models.Model):
def poster(self):
user = User.objects.get(id=self.pid)
return user.username
+
+class Profile(models.Model):
+ user = models.ForeignKey(User)
+ confirmation_code = models.CharField(max_length=255)
+ phone = models.CharField(max_length=20, null=True)
+ address = models.TextField(null=True)
+ created = models.DateTimeField(auto_now_add=True)
+
+ class Meta:
+ app_label = 'website'
diff --git a/website/views.py b/website/views.py
index 3009a6a..de93b7f 100644
--- a/website/views.py
+++ b/website/views.py
@@ -251,7 +251,8 @@ def new_question(request):
question.body = cleaned_data['body'].encode('unicode_escape')
question.views= 1
question.save()
-
+ print "question"
+ print question.id
# Sending email when a new question is asked
subject = 'New Forum Question'
message = """
@@ -271,6 +272,8 @@ def new_question(request):
['team@fossee.in'],
headers={"Content-type":"text/html;charset=iso-8859-1"}
)
+ print message
+ print "****************"
email.attach_alternative(message, "text/html")
email.send(fail_silently=True)
# End of email send