Can't edit canonical domain
## Details

Putting in a canonical domain and then trying to change the domain name results in "Only 1 Domain can be canonical at a time."

## Expected Result

Domain is updated with new domain name

## Actual Result

Form errors.

diff --git a/readthedocs/projects/forms.py b/readthedocs/projects/forms.py
index 5cd9fad44..a2f868c8a 100644
--- a/readthedocs/projects/forms.py
+++ b/readthedocs/projects/forms.py
@@ -570,9 +570,10 @@ class DomainForm(forms.ModelForm):
 
     def clean_canonical(self):
         canonical = self.cleaned_data['canonical']
+        _id = self.initial.get('id')
         if canonical and Domain.objects.filter(
-                project=self.project, canonical=True).exclude(
-                    domain=self.cleaned_data['domain']).exists():
+                project=self.project, canonical=True
+        ).exclude(pk=_id).exists():
             raise forms.ValidationError(
                 _('Only 1 Domain can be canonical at a time.'))
         return canonical
diff --git a/readthedocs/rtd_tests/tests/test_domains.py b/readthedocs/rtd_tests/tests/test_domains.py
index a92e9fab2..c786bb523 100644
--- a/readthedocs/rtd_tests/tests/test_domains.py
+++ b/readthedocs/rtd_tests/tests/test_domains.py
@@ -81,6 +81,26 @@ class FormTests(TestCase):
                           project=self.project)
         self.assertFalse(form.is_valid())
 
+    def test_canonical_change(self):
+        """Make sure canonical can be properly changed"""
+        form = DomainForm({'domain': 'example.com', 'canonical': True},
+                          project=self.project)
+        self.assertTrue(form.is_valid())
+        domain = form.save()
+        self.assertEqual(domain.domain, 'example.com')
+
+        form = DomainForm({'domain': 'example2.com', 'canonical': True},
+                          project=self.project)
+        self.assertFalse(form.is_valid())
+        self.assertEqual(form.errors['canonical'][0], 'Only 1 Domain can be canonical at a time.')
+
+        form = DomainForm({'domain': 'example2.com', 'canonical': True},
+                          project=self.project,
+                          instance=domain)
+        self.assertTrue(form.is_valid())
+        domain = form.save()
+        self.assertEqual(domain.domain, 'example2.com')
+
 
 class TestAPI(TestCase):
 
['readthedocs/rtd_tests/tests/test_domains.py', 'readthedocs/projects/forms.py']