aboutsummaryrefslogtreecommitdiffstats
path: root/manage.py (unfollow)
Commit message (Collapse)AuthorLines
2019-10-08Migrate undesirable active infraction to inactiveGravatar Sebastiaan Zeeff-0/+754
https://github.com/python-discord/site/issues/273 This commit adds a data migration to migrate active infractions that should not be active to inactive. There are two types of infractions that this migration will migrate to inactive: - Infractions of types that should never be active (e.g. notes) - Secondary active infractions if a given user already has an active infraction of the same type. Since this makes the migration file fairly complex, I have written tests to make sure the migration works as expected. In order to do this, I've subclassed `django.test.TestCase` to create a `MigrationsTestCase` that takes care of reverting the database back to a state prior to the migrations we want to test and injects test data before applying the migrations we want to test. For more information, see `pydis_site.apps.api.tests.migrations.base` This implements the last part of and closes #273
2019-10-07Add validation rules to Infraction serializerGravatar Sebastiaan Zeeff-1/+99
https://github.com/python-discord/site/issues/273 This commit adds validation rules to the Infraction serializer that validate if a given infraction should be accepted based on its status of being considered `active`. If the validation fails, the API will reject the request and return a 400 status. Specifically, this validator checks that: - infractions that can never be active do not have `active=True` set; - a user can never receive a second active infraction of the same type. Tests have been added to `test_infractions.py` to ensure that the validators work as expected. This commit implements the first part of #273
2019-10-06disable usage of pyuwsgi on windows due to incompatibility, library is only ↵Gravatar Joseph Banks-65/+66
used in production anyway
2019-10-03Fix migrations exclude in flake8Gravatar MarkKoz-1/+1
They were not being excluded when flake8 was invoked via pre-commit.
2019-09-30Update contrib doc to point to new wiki linksGravatar sco1-2/+2
2019-09-30Add link to Contributing landing page to navbarGravatar Sebastiaan Zeeff-0/+3
This commit adds a link to the Contributing landing page to the navbar on our website.
2019-09-30Monkeypatch in new HEADER_ID_PREFIX.Gravatar Leon Sandøy-0/+4
Currently, all toc-links will have a wiki-toc prefix. This commit removes this prefix, so that we can header link with just something like #environment instead of #wiki-toc-environment. This addresses #276. https://github.com/python-discord/site/issues/267
2019-09-30Create superuser after doing migrations.Gravatar Leon Sandøy-1/+3
Previously, the create_superuser() command was called before migrations had been completed on local setups, and this would cause the command to crash, saying that the table did not exist.
2019-09-30Correct the Dockerfile path for azure.Gravatar scragly-1/+1
2019-09-29Poll the database a maximum of 10 attempts before exit code 1.Gravatar scragly-1/+7
2019-09-29Remove useless verbosity check.Gravatar scragly-1/+1
2019-09-29Remove rogue image fileGravatar kosayoda-0/+0
2019-09-28Add static images for wiki contributing guidesGravatar kosayoda-0/+0
2019-09-28Fix comments after previous changes.Gravatar scragly-2/+2
2019-09-28Support internal docker network DNS resolution & dev ALLOWED_HOSTS env var.Gravatar scragly-6/+19
2019-09-28Automatically create a default bot api token for dev.Gravatar scragly-6/+22
2019-09-28Create custom manage.py entry point, remove scripts and merge Dockerfile.Gravatar scragly-106/+197
2019-09-27Ensure docker containers are published only for master branch builds.Gravatar scragly-1/+1
2019-09-26Reject unhidden note or hidden warning infractionGravatar Sebastiaan Zeeff-15/+38
https://github.com/python-discord/site/issues/260 This commit adds validation steps to the InfractionSerializer to make sure that `"warning"` infractions can never be set with `hidden=True` and note infractions can never be set with `hidden=False` usng the API. This is the final step in decoupling "note" infractions and "warning" infractions. This commit implements the final part of and closes #260