Change server error to admin error
Bug : T287003
@@ -279,7 +279,13 @@ class Partner(models.Model):
)
# New tag model that uses JSONField instead of Taggit to make tags translatable
- new_tags = models.JSONField(null=True, default=None, blank=True)
+
+ new_tags = models.JSONField(
+ null=True,
+ default=None,
+ blank=True,
+ help_text="Tag must be a valid JSON schema. Tag should be in the form of TagName_tag.",
+ )
# Non-universal form fields
# --------------------------------------------------------------------------
@@ -406,11 +412,6 @@ class Partner(models.Model):
if not self.target_url:
raise ValidationError("Proxy and Bundle partners require a target URL.")
- def get_absolute_url(self):
- return reverse_lazy("partners:detail", kwargs={"pk": self.pk})
-
- def save(self, *args, **kwargs):
- super(Partner, self).save(*args, **kwargs)
# If new_tags is not empty, validate with JSONSchema
if self.new_tags is not None:
try:
@@ -423,6 +424,9 @@ class Partner(models.Model):
"Error trying to insert a tag: the JSON is invalid"
)
+ def get_absolute_url(self):
+ return reverse_lazy("partners:detail", kwargs={"pk": self.pk})
+
@property
def get_languages(self):
return self.languages.all()
