Browse Source

Add desc to hc.api.schemas.check

pull/320/head
Pēteris Caune 5 years ago
parent
commit
bffb51357e
No known key found for this signature in database GPG Key ID: E28D7679E9A9EDE2
3 changed files with 11 additions and 0 deletions
  1. +1
    -0
      CHANGELOG.md
  2. +1
    -0
      hc/api/schemas.py
  3. +9
    -0
      hc/api/tests/test_update_check.py

+ 1
- 0
CHANGELOG.md View File

@ -9,6 +9,7 @@ All notable changes to this project will be documented in this file.
- Added JSON endpoint for Shields.io (#304) - Added JSON endpoint for Shields.io (#304)
- Django 3.0 - Django 3.0
- `senddeletionnotices` command skips profiles with recent last_active_date - `senddeletionnotices` command skips profiles with recent last_active_date
- The "Update Check" API call can update check's description (#311)
### Bug Fixes ### Bug Fixes
- Don't set CSRF cookie on first visit. Signup is exempt from CSRF protection - Don't set CSRF cookie on first visit. Signup is exempt from CSRF protection


+ 1
- 0
hc/api/schemas.py View File

@ -2,6 +2,7 @@ check = {
"type": "object", "type": "object",
"properties": { "properties": {
"name": {"type": "string", "maxLength": 100}, "name": {"type": "string", "maxLength": 100},
"desc": {"type": "string"},
"tags": {"type": "string", "maxLength": 500}, "tags": {"type": "string", "maxLength": 500},
"timeout": {"type": "number", "minimum": 60, "maximum": 2592000}, "timeout": {"type": "number", "minimum": 60, "maximum": 2592000},
"grace": {"type": "number", "minimum": 60, "maximum": 2592000}, "grace": {"type": "number", "minimum": 60, "maximum": 2592000},


+ 9
- 0
hc/api/tests/test_update_check.py View File

@ -164,3 +164,12 @@ class UpdateCheckTestCase(BaseTestCase):
r = self.post(self.check.code, {"api_key": "X" * 32, "channels": None}) r = self.post(self.check.code, {"api_key": "X" * 32, "channels": None})
self.assertEqual(r.status_code, 400) self.assertEqual(r.status_code, 400)
def test_it_rejects_non_string_desc(self):
r = self.post(
self.check.code, {"api_key": "X" * 32, "desc": 123}
)
self.assertEqual(r.status_code, 400)
self.check.refresh_from_db()

Loading…
Cancel
Save