diff --git a/junction/profiles/admin.py b/junction/profiles/admin.py index c89fa76c..01695ca9 100644 --- a/junction/profiles/admin.py +++ b/junction/profiles/admin.py @@ -6,4 +6,5 @@ class ProfileAdmin(admin.ModelAdmin): list_display = ('user', 'city', 'contact_no') search_fields = ('contact_no', 'city') + admin.site.register(Profile, ProfileAdmin) diff --git a/junction/templates/proposals/detail/comments.html b/junction/templates/proposals/detail/comments.html index 1167ee7c..1f3c1e32 100644 --- a/junction/templates/proposals/detail/comments.html +++ b/junction/templates/proposals/detail/comments.html @@ -89,7 +89,7 @@
{% bootstrap_field proposal_comment_form.reviewer %} {% buttons %} - @@ -138,6 +138,23 @@
location.reload(true); }); }); + $("textarea").keypress(function(){ + $(".alert").remove() + var text = $("textarea").val(); + if (text.length<15) { + $(this).after("

Remember! Length should be greater than 15!

"); + } + }) + + $("#comment").click(function() { + $(".alert").remove() + var text = $("textarea").val(); + if (text.length >= 15) { + $("form").submit(); + } else { + $("textarea").after("

Oops! Length should be greater than 15.

"); + } + }) {% else %} $('.js-proposal-upvote, .js-proposal-downvote, .js-proposal-comment-upvote, .js-proposal-comment-downvote').click(function(e){ diff --git a/settings/common.py b/settings/common.py index febe1fab..bf55ff78 100644 --- a/settings/common.py +++ b/settings/common.py @@ -103,7 +103,7 @@ "junction.base.context_processors.site_info", ], - 'debug': DEBUG, + 'debug': DEBUG, # noqa }, }, ] diff --git a/settings/test_settings.py b/settings/test_settings.py index a9d0ac93..96c451eb 100644 --- a/settings/test_settings.py +++ b/settings/test_settings.py @@ -11,16 +11,16 @@ DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', - 'NAME': os.path.join(ROOT_DIR, 'test.sqlite3'), + 'NAME': os.path.join(ROOT_DIR, 'test.sqlite3'), # noqa } } -TEMPLATE_CONTEXT_PROCESSORS += ( +TEMPLATE_CONTEXT_PROCESSORS += ( # noqa "django.core.context_processors.debug", ) EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' -INSTALLED_APPS += ('django_extensions',) +INSTALLED_APPS += ('django_extensions',) # noqa DEVICE_VERIFICATION_CODE = 11111 diff --git a/tests/integrations/test_reviewer_views.py b/tests/integrations/test_reviewer_views.py index 3ce2f60d..f4cc5068 100644 --- a/tests/integrations/test_reviewer_views.py +++ b/tests/integrations/test_reviewer_views.py @@ -22,7 +22,7 @@ def test_reviewer_private_comment(self, settings, login, conferences, data = {'comment': 'Test', 'private': True} response = client.post(url, data) - + print(response.url) assert response.status_code == 302 assert response.url.endswith('#js-reviewers')