[extensions-web] Always include the contact information when submitting an error report
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [extensions-web] Always include the contact information when submitting an error report
- Date: Sun, 18 Dec 2011 00:51:09 +0000 (UTC)
commit f51b92450c9e7c508c13e193abe113d5ceaa6987
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Sat Dec 17 02:36:57 2011 -0500
Always include the contact information when submitting an error report
It was a bad idea to make this optional. Extension authors are forever
pained by this misfeature, so I'm going to remove it.
sweettooth/errorreports/forms.py | 4 -
...0006_auto__del_field_errorreport_can_contact.py | 84 ++++++++++++++++++++
sweettooth/errorreports/models.py | 1 -
.../templates/errorreports/report.html | 4 -
.../templates/errorreports/report_mail.txt | 4 -
.../errorreports/templates/errorreports/view.html | 4 -
sweettooth/errorreports/tests.py | 21 +----
7 files changed, 87 insertions(+), 35 deletions(-)
---
diff --git a/sweettooth/errorreports/forms.py b/sweettooth/errorreports/forms.py
index cbf1b58..717e6a5 100644
--- a/sweettooth/errorreports/forms.py
+++ b/sweettooth/errorreports/forms.py
@@ -6,7 +6,6 @@ from errorreports.models import ErrorReport
class ErrorReportForm(forms.ModelForm):
comment = forms.CharField(widget=forms.Textarea())
- can_contact = forms.BooleanField(label="I wish to provide the extension author with my email address", required=False)
class Meta:
model = ErrorReport
@@ -15,9 +14,6 @@ class ErrorReportForm(forms.ModelForm):
def clean_comment(self):
return self.cleaned_data['comment'].strip()
- def clean_can_contact(self):
- return self.cleaned_data.get('can_contact', False)
-
def save(self, request, extension, commit=True):
report = super(ErrorReportForm, self).save(commit=False)
report.user = request.user
diff --git a/sweettooth/errorreports/migrations/0006_auto__del_field_errorreport_can_contact.py b/sweettooth/errorreports/migrations/0006_auto__del_field_errorreport_can_contact.py
new file mode 100644
index 0000000..89aaf6c
--- /dev/null
+++ b/sweettooth/errorreports/migrations/0006_auto__del_field_errorreport_can_contact.py
@@ -0,0 +1,84 @@
+# encoding: utf-8
+import datetime
+from south.db import db
+from south.v2 import SchemaMigration
+from django.db import models
+
+class Migration(SchemaMigration):
+
+ def forwards(self, orm):
+
+ # Deleting field 'ErrorReport.can_contact'
+ db.delete_column('errorreports_errorreport', 'can_contact')
+
+
+ def backwards(self, orm):
+
+ # Adding field 'ErrorReport.can_contact'
+ db.add_column('errorreports_errorreport', 'can_contact', self.gf('django.db.models.fields.BooleanField')(default=False), keep_default=False)
+
+
+ models = {
+ 'auth.group': {
+ 'Meta': {'object_name': 'Group'},
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
+ 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
+ },
+ 'auth.permission': {
+ 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
+ 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
+ },
+ 'auth.user': {
+ 'Meta': {'object_name': 'User'},
+ 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
+ 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
+ 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
+ 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
+ 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
+ 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
+ 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
+ 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
+ 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
+ },
+ 'contenttypes.contenttype': {
+ 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
+ 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
+ },
+ 'errorreports.errorreport': {
+ 'Meta': {'object_name': 'ErrorReport'},
+ 'comment': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
+ 'extension': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['extensions.Extension']", 'null': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['auth.User']"})
+ },
+ 'extensions.extension': {
+ 'Meta': {'object_name': 'Extension'},
+ 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
+ 'creator': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}),
+ 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
+ 'disables': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
+ 'downloads': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}),
+ 'enables': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
+ 'icon': ('django.db.models.fields.files.ImageField', [], {'default': "'/static/images/plugin.png'", 'max_length': '100', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '200'}),
+ 'popularity': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
+ 'screenshot': ('sorl.thumbnail.fields.ImageField', [], {'max_length': '100', 'blank': 'True'}),
+ 'slug': ('autoslug.fields.AutoSlugField', [], {'unique_with': '()', 'max_length': '50', 'populate_from': 'None', 'db_index': 'True'}),
+ 'url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}),
+ 'uuid': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '200', 'db_index': 'True'})
+ }
+ }
+
+ complete_apps = ['errorreports']
diff --git a/sweettooth/errorreports/models.py b/sweettooth/errorreports/models.py
index 3c3e512..b12c38e 100644
--- a/sweettooth/errorreports/models.py
+++ b/sweettooth/errorreports/models.py
@@ -8,6 +8,5 @@ class ErrorReport(models.Model):
comment = models.TextField(blank=True)
user = models.ForeignKey(auth.models.User, related_name="+")
extension = models.ForeignKey(Extension, null=True)
- can_contact = models.BooleanField()
error_reported = Signal(providing_args=["request", "version", "report"])
diff --git a/sweettooth/errorreports/templates/errorreports/report.html b/sweettooth/errorreports/templates/errorreports/report.html
index 1f18b9d..65008f4 100644
--- a/sweettooth/errorreports/templates/errorreports/report.html
+++ b/sweettooth/errorreports/templates/errorreports/report.html
@@ -10,10 +10,6 @@
<h3> Comments for the author </h3>
{{ form.comment }}
- <p>GNOME Shell Extensions will not provide the extension author with any contact information by default. If you wish to be contacted by the extension author, please check the box below.</p>
-
- {{ form.can_contact }} {{ form.can_contact.label_tag }}
-
<input type="submit" value="Report Errors">
</form>
diff --git a/sweettooth/errorreports/templates/errorreports/report_mail.txt b/sweettooth/errorreports/templates/errorreports/report_mail.txt
index a9fd39f..7ef12ff 100644
--- a/sweettooth/errorreports/templates/errorreports/report_mail.txt
+++ b/sweettooth/errorreports/templates/errorreports/report_mail.txt
@@ -2,13 +2,9 @@ Your extension, "{{ extension.name }}" has received an error report from {{ repo
{{ report.comment }}
-{% if report.can_contact %}
Please email the reporter back to respond. The user's address is:
{{ report.user.email }}
-{% else %}
-The reporter did not wish to provide you with his contact information.
-{% endif %}
You can see the full report at:
diff --git a/sweettooth/errorreports/templates/errorreports/view.html b/sweettooth/errorreports/templates/errorreports/view.html
index 59722b0..e38e752 100644
--- a/sweettooth/errorreports/templates/errorreports/view.html
+++ b/sweettooth/errorreports/templates/errorreports/view.html
@@ -9,12 +9,8 @@
</div>
<h3> Contact information </h3>
-{% if report.can_contact %}
<p>Please email the reporter back to respond. The user's address is:</p>
<a class="email" href="mailto:{{ report.user.email }}">{{ report.user.email }}</a>
-{% else %}
-<p>The reporter did not provide you with his contact information.</p>
-{% endif %}
{% endblock %}
{% block navclass %}main{% endblock %}
diff --git a/sweettooth/errorreports/tests.py b/sweettooth/errorreports/tests.py
index 54c7088..f4b31a8 100644
--- a/sweettooth/errorreports/tests.py
+++ b/sweettooth/errorreports/tests.py
@@ -28,26 +28,11 @@ class SubmitErrorReportTestCase(TestCase):
self.extension.save()
self.version.save()
- def test_no_contact_information(self):
- comment = "No contact information"
+ def test_email_sent(self):
+ comment = "YOUR EXTENSION SUCKS IT BROKE"
self.client.post(reverse('errorreports-report', kwargs=dict(pk=self.extension.pk)),
- dict(can_contact=False,
- comment=comment), follow=True)
+ dict(comment=comment), follow=True)
self.assertEqual(len(mail.outbox), 1)
self.assertIn(comment, mail.outbox[0].body)
- error_report = models.ErrorReport.objects.get(comment=comment)
- self.assertEqual(error_report.can_contact, False)
-
- def test_with_contact_information(self):
- comment = "With contact information"
-
- self.client.post(reverse('errorreports-report', kwargs=dict(pk=self.extension.pk)),
- dict(can_contact=True,
- comment=comment), follow=True)
-
- self.assertEqual(len(mail.outbox), 1)
- self.assertIn(comment, mail.outbox[0].body)
- error_report = models.ErrorReport.objects.get(comment=comment)
- self.assertEqual(error_report.can_contact, True)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]