Skip to content
This repository was archived by the owner on May 5, 2025. It is now read-only.

Commit 7935e52

Browse files
Ensure that language validation works on all supported languages (#459)
The database has a set of enum validation which is different from the in-code validation that we do when checking that the language is valid. This should ensure that the language set looks the same.
1 parent abc6b36 commit 7935e52

File tree

1 file changed

+2
-22
lines changed

1 file changed

+2
-22
lines changed

shared/torngit/base.py

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
import httpx
66

7+
from shared.django_apps.core.models import Repository
78
from shared.torngit.cache import torngit_cache
89
from shared.torngit.enums import Endpoints
910
from shared.torngit.response_types import ProviderPull
@@ -38,28 +39,7 @@ class TorngitBaseAdapter(object):
3839
_token: Token | None = None
3940
verify_ssl = None
4041

41-
valid_languages = (
42-
"javascript",
43-
"shell",
44-
"python",
45-
"ruby",
46-
"perl",
47-
"dart",
48-
"java",
49-
"c",
50-
"clojure",
51-
"d",
52-
"fortran",
53-
"go",
54-
"groovy",
55-
"kotlin",
56-
"php",
57-
"r",
58-
"scala",
59-
"swift",
60-
"objective-c",
61-
"xtend",
62-
)
42+
valid_languages = set(language.value for language in Repository.Languages)
6343

6444
def __init__(
6545
self,

0 commit comments

Comments
 (0)