0
0
Fork 0
mirror of https://github.com/healthchecks/healthchecks.git synced 2025-04-03 04:15:29 +00:00

Add default value (uuid.uuidv4()) for Check.badge_key

cc: 
This commit is contained in:
Pēteris Caune 2024-12-27 11:36:48 +02:00
parent c498f2e047
commit 8dab5d8c36
No known key found for this signature in database
GPG key ID: E28D7679E9A9EDE2
3 changed files with 21 additions and 2 deletions

View file

@ -28,7 +28,7 @@ class ChecksAdmin(ModelAdmin[Check]):
css = {"all": ("css/admin/checks.css",)}
search_fields = ["name", "code", "project__owner__email"]
readonly_fields = ("code",)
readonly_fields = ("code", "badge_key")
raw_id_fields = ("project",)
list_select_related = ("project",)
list_display = (

View file

@ -0,0 +1,19 @@
# Generated by Django 5.1.4 on 2024-12-27 09:24
import uuid
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('api', '0115_flip_api_flip_owner_created'),
]
operations = [
migrations.AlterField(
model_name='check',
name='badge_key',
field=models.UUIDField(default=uuid.uuid4, null=True, unique=True),
),
]

View file

@ -195,7 +195,7 @@ class Check(models.Model):
failure_kw = models.CharField(max_length=200, blank=True)
methods = models.CharField(max_length=30, blank=True)
manual_resume = models.BooleanField(default=False)
badge_key = models.UUIDField(null=True, unique=True)
badge_key = models.UUIDField(default=uuid.uuid4, null=True, unique=True)
n_pings = models.IntegerField(default=0)
last_ping = models.DateTimeField(null=True, blank=True)