diff options
-rw-r--r-- | servo/migrations/0040_auto_20151020_2226.py | 29 | ||||
-rw-r--r-- | servo/models/device.py | 2 | ||||
-rw-r--r-- | servo/models/repair.py | 12 | ||||
-rwxr-xr-x | servo/templates/orders/gsx_repair_form.html | 3 | ||||
-rw-r--r-- | servo/views/gsx.py | 2 |
5 files changed, 43 insertions, 5 deletions
diff --git a/servo/migrations/0040_auto_20151020_2226.py b/servo/migrations/0040_auto_20151020_2226.py new file mode 100644 index 0000000..558bdf5 --- /dev/null +++ b/servo/migrations/0040_auto_20151020_2226.py @@ -0,0 +1,29 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('servo', '0039_auto_20151016_1307'), + ] + + operations = [ + migrations.AddField( + model_name='repair', + name='acplus', + field=models.NullBooleanField(default=None, help_text='Unit is covered by AppleCare+'), + ), + migrations.AlterField( + model_name='template', + name='content', + field=models.TextField(verbose_name='Content'), + ), + migrations.AlterField( + model_name='template', + name='title', + field=models.CharField(default='New Template', unique=True, max_length=128, verbose_name='Title'), + ), + ] diff --git a/servo/models/device.py b/servo/models/device.py index af7ce83..3c162df 100644 --- a/servo/models/device.py +++ b/servo/models/device.py @@ -189,7 +189,7 @@ class Device(models.Model): help_text=_('Device is considered vintage in GSX') ) fmip_active = models.BooleanField(default=False, editable=False) - + def is_apple_device(self): """ Checks if this is a valid Apple device SN diff --git a/servo/models/repair.py b/servo/models/repair.py index 7c9d595..df11afa 100644 --- a/servo/models/repair.py +++ b/servo/models/repair.py @@ -178,7 +178,12 @@ class Repair(models.Model): component_data = models.TextField(default='', editable=False) consumer_law = models.NullBooleanField( default=None, - help_text=_('Unit is eligible for consumer law coverage') + help_text=_('Repair is eligible for consumer law coverage') + ) + acplus = models.NullBooleanField( + default=None, + verbose_name=_('AppleCare+'), + help_text=_('Repair is covered by AppleCare+') ) symptom_code = models.CharField(max_length=7, default='') @@ -438,6 +443,9 @@ class Repair(models.Model): if self.consumer_law is not None: data['consumerLawEligible'] = self.consumer_law + if self.acplus is not None: + data['acPlusFlag'] = self.acplus + return data def has_serialized_parts(self): @@ -463,7 +471,7 @@ class Repair(models.Model): try: r = l.component_check(parts) - except gsxws.GsxError, e: + except gsxws.GsxError as e: if e.code == "COMP.LKP.004": return # Symptom Code not required for Replacement and Other category parts. raise e diff --git a/servo/templates/orders/gsx_repair_form.html b/servo/templates/orders/gsx_repair_form.html index 2751b5e..aa1daf1 100755 --- a/servo/templates/orders/gsx_repair_form.html +++ b/servo/templates/orders/gsx_repair_form.html @@ -59,11 +59,12 @@ </div> <div class="tab-pane" id="tab2"> {% include "form_field_snippet.html" with field=repair_form.notes %} + {% include "form_field_snippet.html" with field=repair_form.request_review %} {% include "form_field_snippet.html" with field=repair_form.unit_received_at %} {% include "form_field_snippet.html" with field=repair_form.attachment %} {% include "form_field_snippet.html" with field=repair_form.reference %} {% include "form_field_snippet.html" with field=repair_form.consumer_law %} - {% include "form_field_snippet.html" with field=repair_form.request_review %} + {% include "form_field_snippet.html" with field=repair_form.acplus %} {% if repair.can_mark_complete %} {% include "form_field_snippet.html" with field=repair_form.replacement_sn %} {% include "form_field_snippet.html" with field=repair_form.mark_complete %} diff --git a/servo/views/gsx.py b/servo/views/gsx.py index d8e1083..493f3cf 100644 --- a/servo/views/gsx.py +++ b/servo/views/gsx.py @@ -160,6 +160,7 @@ def check_parts_warranty(request, repair): try: wty = repair.warranty_status() wty_parts = wty.parts + repair.acplus = wty.acPlusFlag except Exception as e: return render(request, 'search/results/gsx_error.html', {'message': e}) @@ -216,7 +217,6 @@ def edit_repair(request, order_id, repair_id): repair = get_object_or_404(Repair, pk=repair_id) if request.GET.get('c'): - from django import forms repair.symptom_code = request.GET['c'] repair.save() choices = repair.get_issue_code_choices() |