diff --git a/backend/db.sqlite3 b/backend/db.sqlite3 index c569ecb..92f7380 100644 Binary files a/backend/db.sqlite3 and b/backend/db.sqlite3 differ diff --git a/backend/postings/migrations/0005_review_author_name.py b/backend/postings/migrations/0005_review_author_name.py new file mode 100644 index 0000000..dae5770 --- /dev/null +++ b/backend/postings/migrations/0005_review_author_name.py @@ -0,0 +1,18 @@ +# Generated by Django 2.1.1 on 2018-10-18 08:30 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('postings', '0004_remove_reviewhelpfulvote_user'), + ] + + operations = [ + migrations.AddField( + model_name='review', + name='author_name', + field=models.CharField(default='Anonymous', max_length=64), + ), + ] diff --git a/backend/postings/models.py b/backend/postings/models.py index de4c017..f6ca417 100644 --- a/backend/postings/models.py +++ b/backend/postings/models.py @@ -74,6 +74,8 @@ class Review(models.Model): last_updated_date = models.DateTimeField(auto_now=True) # A reference to the person who created this review. author = models.ForeignKey('postings.User', on_delete=models.PROTECT, null=True, blank=True) + # TEMPORARY: Name of person who gave review. + author_name = models.CharField(max_length=64, default='Anonymous') # Gets the total number of votes which marked this review as 'helpful'. @property diff --git a/backend/postings/templates/postings/frontend/entity.html b/backend/postings/templates/postings/frontend/entity.html index 52c58aa..3350487 100644 --- a/backend/postings/templates/postings/frontend/entity.html +++ b/backend/postings/templates/postings/frontend/entity.html @@ -55,8 +55,8 @@ {# Username input #}
- - + +
{# Title input #} diff --git a/backend/postings/templates/postings/frontend/review.html b/backend/postings/templates/postings/frontend/review.html index ab4f843..6e83a36 100644 --- a/backend/postings/templates/postings/frontend/review.html +++ b/backend/postings/templates/postings/frontend/review.html @@ -7,7 +7,7 @@ {# Username #} -
Student
+
{{ review.author_name }}
{# Date at which review was posted. #}
{{ review.created_date|date:"j M, Y" }}
diff --git a/backend/postings/views.py b/backend/postings/views.py index bf668c8..89c1225 100644 --- a/backend/postings/views.py +++ b/backend/postings/views.py @@ -71,6 +71,7 @@ def post_review(request): if form.is_valid(): # Only if the request is a POST and the form is valid do we do anything. rating = form.cleaned_data['rating'] + name = form.cleaned_data['name'] title = form.cleaned_data['title'] content = form.cleaned_data['content'] entity_id = form.cleaned_data['entity_id']