.
This commit is contained in:
@@ -124,6 +124,11 @@ class QuestionNote(models.Model):
|
||||
#author = models.ForeignKey(User,
|
||||
|
||||
author = models.CharField(max_length=200, blank=True)
|
||||
|
||||
user_author = models.ForeignKey( settings.AUTH_USER_MODEL,
|
||||
related_name="rapid_notes",
|
||||
on_delete=models.CASCADE, blank=True)
|
||||
|
||||
note = models.TextField()
|
||||
created_on = models.DateTimeField(auto_now_add=True)
|
||||
|
||||
|
||||
@@ -209,6 +209,7 @@ class AddQuestionNote(CreateView):
|
||||
kwargs = super(AddQuestionNote, self).get_form_kwargs()
|
||||
# update the kwargs for the form init method with yours
|
||||
kwargs.update(self.kwargs) # self.kwargs contains all url conf params
|
||||
kwargs.update({"user": self.request.user})
|
||||
return kwargs
|
||||
|
||||
def get_initial(self):
|
||||
|
||||
Reference in New Issue
Block a user