aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeLines
* Prevent double active infractions with constraintGravatar Sebastiaan Zeeff2019-10-08-2/+111
| | | | | | | | | | | https://github.com/python-discord/site/issues/273 This commits adds a UniqueConstraint for active infractions on a combination of the `user` and `type` field. This means that a user can only have one active infraction of a given type in the database at any time. I've also added tests to make sure that this behaves as expected.
* Migrate undesirable active infraction to inactiveGravatar Sebastiaan Zeeff2019-10-08-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
* Add validation rules to Infraction serializerGravatar Sebastiaan Zeeff2019-10-07-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
* disable usage of pyuwsgi on windows due to incompatibility, library is only ↵Gravatar Joseph Banks2019-10-06-65/+66
| | | | used in production anyway
* Merge pull request #275 from python-discord/flake8-exclude-fixGravatar Sebastiaan Zeeff2019-10-04-1/+1
|\ | | | | Fix migrations exclude in flake8
| * Fix migrations exclude in flake8Gravatar MarkKoz2019-10-03-1/+1
|/ | | | They were not being excluded when flake8 was invoked via pre-commit.
* Add link to Contributing landing page to our website's navbar (#270)Gravatar scragly2019-10-01-0/+3
|\ | | | | Add link to Contributing landing page to our website's navbar
| * Add link to Contributing landing page to navbarGravatar Sebastiaan Zeeff2019-09-30-0/+3
| | | | | | | | | | This commit adds a link to the Contributing landing page to the navbar on our website.
* | Merge pull request #271 from python-discord/update-contrib-docGravatar scragly2019-10-01-2/+2
|\ \ | | | | | | Update contrib doc to point to new wiki links
| * | Update contrib doc to point to new wiki linksGravatar sco12019-09-30-2/+2
|/ /
* | Monkeypatch in new HEADER_ID_PREFIX. (#268)Gravatar scragly2019-10-01-0/+4
|\ \ | |/ |/| Monkeypatch in new HEADER_ID_PREFIX.
| * Monkeypatch in new HEADER_ID_PREFIX.Gravatar Leon Sandøy2019-09-30-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
* Create superuser after doing migrations.Gravatar Leon Sandøy2019-09-30-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.
* Merge pull request #261 from python-discord/decoupling-warnings-and-notesGravatar Sebastiaan Zeeff2019-09-30-15/+61
|\ | | | | Migrate hidden warnings to notes and add additional validation
| * Merge branch 'master' into decoupling-warnings-and-notesGravatar Leon Sandøy2019-09-30-114/+240
| |\ | |/ |/|
* | Correct the Dockerfile path for azure.Gravatar scragly2019-09-30-1/+1
| |
* | Merge pull request #265 from python-discord/new-managepyGravatar Leon Sandøy2019-09-29-112/+238
|\ \ | | | | | | Custom `manage.py` Entry Point Script
| * \ Merge branch 'master' into new-managepyGravatar Leon Sandøy2019-09-29-0/+0
| |\ \ | |/ / |/| |
* | | Add static images for wiki contributing guides (#266)Gravatar scragly2019-09-29-0/+0
|\ \ \ | | | | | | | | Add static images for wiki contributing guides
| * | | Remove rogue image fileGravatar kosayoda2019-09-29-0/+0
| | | |
| * | | Add static images for wiki contributing guidesGravatar kosayoda2019-09-28-0/+0
|/ / /
| * | Poll the database a maximum of 10 attempts before exit code 1.Gravatar scragly2019-09-29-1/+7
| | |
| * | Remove useless verbosity check.Gravatar scragly2019-09-29-1/+1
| | |
| * | Fix comments after previous changes.Gravatar scragly2019-09-28-2/+2
| | |
| * | Support internal docker network DNS resolution & dev ALLOWED_HOSTS env var.Gravatar scragly2019-09-28-6/+19
| | |
| * | Automatically create a default bot api token for dev.Gravatar scragly2019-09-28-6/+22
| | |
| * | Create custom manage.py entry point, remove scripts and merge Dockerfile.Gravatar scragly2019-09-28-106/+197
|/ /
* | Ensure docker containers are published only for master branch bu… (#264)Gravatar scragly2019-09-27-1/+1
|\ \ | | | | | | Ensure docker containers are published only for master branch builds.
| * | Ensure docker containers are published only for master branch builds.Gravatar scragly2019-09-27-1/+1
|/ /
| * Reject unhidden note or hidden warning infractionGravatar Sebastiaan Zeeff2019-09-26-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
| * Migrate hidden warnings to notesGravatar Sebastiaan Zeeff2019-09-26-0/+23
|/ | | | | | | | | | | | | https://github.com/python-discord/site/issues/260 We have added a new "note" type to the Infraction model, meaning that we can now decouple notes and warnings completely. However, notes made prior to this change are still registered as "hidden warnings". This commit adds a data migration that sets the type field of "hidden warning" infractions to "note". This commit implements the first part of #260
* Merge pull request #251 from python-discord/update-lintingGravatar S. Co12019-09-24-92/+127
|\ | | | | Update linting dependencies & relint
| * Merge branch 'master' into update-lintingGravatar S. Co12019-09-24-211/+301
| |\ | |/ |/|
* | Swap out old discord shield for new one.Gravatar scragly2019-09-25-1/+1
| |
* | Add relevant info shieldsGravatar scragly2019-09-23-0/+6
| |
* | Readdressing Docker Refinement (#257)Gravatar scragly2019-09-23-56/+153
|\ \ | | | | | | Readdressing Docker Refinement
| * | Install pipenv & pyuwsgi before copying project for better layer caching.Gravatar scragly2019-09-23-2/+8
| | |
| * | Fix shell script name for whl building to reference wiki pkg.Gravatar scragly2019-09-21-0/+0
| | |
| * | Change back to official python base image, remove git pkgGravatar scragly2019-09-21-25/+18
| | |
| * | Use a .whl for `wiki` package instead of git repo.Gravatar scragly2019-09-21-35/+133
| | |
* | | Merge pull request #234 from python-discord/django-ot-namesGravatar Mark2019-09-21-7/+11
|\ \ \ | |/ / |/| | Add support for certain unicode characters in ot names
| * | Remove redundant off-topic names list testGravatar MarkKoz2019-09-21-7/+0
| | |
| * | Add test for certain unicode characters in ot namesGravatar MarkKoz2019-09-21-3/+14
|/ /
* | CI Job Merge (#255)Gravatar scragly2019-09-21-94/+83
|\ \ | | | | | | | | | | | | CI Job Merge Co-authored-by: null <[email protected]>
| * | Change CI DB setup to use docker.Gravatar scragly2019-09-21-19/+13
| | |
| * | Run tests with coverage in pipenv scriptGravatar MarkKoz2019-09-20-2/+3
| | |
| * | CI: omit migrations from coverageGravatar MarkKoz2019-09-20-1/+1
| | | | | | | | | | | | * Remove --branch option since it's already specified in .coveragerc
| * | CI: publish XML coverage reportGravatar MarkKoz2019-09-20-2/+9
| | | | | | | | | | | | * Show missing line numbers in report
| * | CI: minor refactoringGravatar MarkKoz2019-09-20-9/+16
| | | | | | | | | | | | | | | | | | * Rename some tasks * Simplify python commands by removing python3 -m * Break up some long lines
| * | CI: publish test results even if a task failsGravatar MarkKoz2019-09-20-0/+1
| | |