Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Remove verbose name form Webhook model. Add missin file with error codes

Maciej Korycinski86338ec672f9
diff --git a/saleor/webhook/error_codes.py b/saleor/webhook/error_codes.py
new file mode 100644
index 0000000000..86a9c07945
--- /dev/null
+++ b/saleor/webhook/error_codes.py
@@ -0,0 +1,9 @@
+from enum import Enum
+
+
+class WebhookErrorCode(Enum):
+ GRAPHQL_ERROR = "graphql_error"
+ INVALID = "invalid"
+ NOT_FOUND = "not_found"
+ REQUIRED = "required"
+ UNIQUE = "unique"
diff --git a/saleor/webhook/migrations/0001_initial.py b/saleor/webhook/migrations/0001_initial.py
index 649800ee77..b62ef81962 100644
--- a/saleor/webhook/migrations/0001_initial.py
+++ b/saleor/webhook/migrations/0001_initial.py
@@ -1,4 +1,4 @@
-# Generated by Django 2.2.4 on 2019-09-12 12:39
+# Generated by Django 2.2.4 on 2019-09-25 14:27
import django.db.models.deletion
from django.db import migrations, models
@@ -8,7 +8,7 @@ class Migration(migrations.Migration):
initial = True
- dependencies = [("account", "0033_serviceaccount")]
+ dependencies = [("account", "0037_delete_serviceaccounttoken")]
operations = [
migrations.CreateModel(
@@ -23,10 +23,7 @@ class Migration(migrations.Migration):
verbose_name="ID",
),
),
- (
- "target_url",
- models.URLField(max_length=255, verbose_name="Target URL"),
- ),
+ ("target_url", models.URLField(max_length=255)),
("is_active", models.BooleanField(default=True)),
("secret_key", models.CharField(blank=True, max_length=255, null=True)),
(
diff --git a/saleor/webhook/models.py b/saleor/webhook/models.py
index e83423a468..2ddefa821b 100644
--- a/saleor/webhook/models.py
+++ b/saleor/webhook/models.py
@@ -8,7 +8,7 @@ class Webhook(models.Model):
service_account = models.ForeignKey(
ServiceAccount, related_name="webhooks", on_delete=models.CASCADE
)
- target_url = models.URLField("Target URL", max_length=255)
+ target_url = models.URLField(max_length=255)
is_active = models.BooleanField(default=True)
secret_key = models.CharField(max_length=255, null=True, blank=True)