Commit ca7c1b56 authored by Guilhem Saurel's avatar Guilhem Saurel
Browse files

drop enum_to_choices

parent cbc5d9f7
Pipeline #15316 failed with stage
in 2 minutes and 59 seconds
...@@ -18,7 +18,7 @@ from django.utils.safestring import mark_safe ...@@ -18,7 +18,7 @@ from django.utils.safestring import mark_safe
from github import Github from github import Github
from gitlab import Gitlab from gitlab import Gitlab
from ndh.models import Links, NamedModel, TimeStampedModel from ndh.models import Links, NamedModel, TimeStampedModel
from ndh.utils import enum_to_choices, query_sum from ndh.utils import query_sum
from .utils import SOURCES, api_next, invalid_mail, slugify_with_dots, valid_name from .utils import SOURCES, api_next, invalid_mail, slugify_with_dots, valid_name
...@@ -76,7 +76,7 @@ class License(models.Model): ...@@ -76,7 +76,7 @@ class License(models.Model):
class Forge(Links, NamedModel): class Forge(Links, NamedModel):
source = models.PositiveSmallIntegerField(choices=enum_to_choices(SOURCES)) source = models.PositiveSmallIntegerField(choices=SOURCES.choices)
url = models.URLField(max_length=200) url = models.URLField(max_length=200)
token = models.CharField(max_length=50, blank=True, null=True) token = models.CharField(max_length=50, blank=True, null=True)
verify = models.BooleanField(default=True) verify = models.BooleanField(default=True)
......
import logging import logging
import re import re
import unicodedata import unicodedata
from enum import IntEnum
import git import git
from django.utils.safestring import mark_safe from django.utils.safestring import mark_safe
from django.db.models import IntegerChoices
logger = logging.getLogger('rainboard.utils') logger = logging.getLogger('rainboard.utils')
SOURCES = IntEnum('Sources', 'github gitlab redmine robotpkg travis') SOURCES = IntegerChoices('Sources', 'github gitlab redmine robotpkg travis')
INVALID_MAILS = ('localhost', 'none', 'noreply', 'example') INVALID_MAILS = ('localhost', 'none', 'noreply', 'example')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment