Skip to content

Commit

Permalink
Improve status choices documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
mfosterw committed Feb 25, 2024
1 parent 51a0453 commit bbe8e4a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
6 changes: 5 additions & 1 deletion democrasite/webiscite/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,18 @@ class Bill(StatusModel, TimeStampedModel):
pull_request = models.ForeignKey(PullRequest, on_delete=models.PROTECT)

class Status(models.TextChoices):
"""The possible statuses for a bill
:meta private:"""

OPEN = "open", _("Open")
APPROVED = "approved", _("Approved")
REJECTED = "rejected", _("Rejected")
FAILED = "failed", _("Not Enough Votes") # Failed to reach quorum
# Translators: PR is short for "pull request"
CLOSED = "closed", _("PR Closed") # PR closed on Github

#:
#:-: The possible statuses for a bill. Use ``Bill.Status.VALUE`` to access.
STATUS = Status.choices
status = StatusField(
max_length=10,
Expand Down
10 changes: 5 additions & 5 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@
import os
import sys

# import django
import django

if os.getenv("READTHEDOCS", default="False") == "True":
os.environ["DJANGO_READ_DOT_ENV_FILE"] = "True"
os.environ["USE_DOCKER"] = "no"
sys.path.insert(0, os.path.abspath("..")) # noqa: PTH100
django_settings = "config.settings.local"
# os.environ["DATABASE_URL"] = "sqlite:///readthedocs.db"
# os.environ["CELERY_BROKER_URL"] = os.getenv("REDIS_URL", "redis://redis:6379")
# os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.local")
# django.setup()
os.environ["DATABASE_URL"] = "sqlite:///readthedocs.db"
os.environ["CELERY_BROKER_URL"] = os.getenv("REDIS_URL", "redis://redis:6379")
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.local")
django.setup()

# -- Project information -----------------------------------------------------

Expand Down

0 comments on commit bbe8e4a

Please sign in to comment.