| Commit message (Collapse) | Author | Lines |
|
The migration files were generated and named before the migrations
added by other pull requests. This caused the migration path to
diverge. Since the migrations did not touch the same models, the
solution was to rename the migration files to place them at the end
of the migration history.
|
|
This commit adds a link to the Code of Conduct to the dropdown menu
in the navbar. It does not include a direct link to the CoC policies,
which are accessible via the Code of Conduct page.
|
|
root shown
|
|
We've already got this handled in the main base template for the site.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This also enforces unique values for both attributes on the RoleMapping model. Supporting configurations where this isn't the case would introduce quite a lot of added complexity.
|
|
This might break local PostgreSQL containers with the following error:
postgres_1 | 2019-10-11 20:01:48.772 UTC [1] FATAL: database files are incompatible with server
postgres_1 | 2019-10-11 20:01:48.772 UTC [1] DETAIL: The data directory was initialized by PostgreSQL version 11, which is not compatible with this version 12.0.
You will need to do one of the following:
- Delete the old data volume and start from scratch (simple, recommended).
As we don't have an explicit volume configured, only the one the PostgreSQL
image uses, this is as simple as running `docker-compose stop` followed by
`docker-compose rm`. Afterwards, you can restart it.
- The dump & restore route. Do this if you don't want to delete your
container data. To do this, first switch the PostgreSQL version in
`docker-compose.yml` back to `11`, then run the following commands:
docker-compose stop # Stop all containers
docker-compose start postgres # Start the database
docker-compose exec postgres pg_dumpall -U pysite > db.sql # Pull a SQL dump
docker-compose stop # Stop the containers again
docker-compose rm # Remove the containers
Now, update the PostgreSQL version in `docker-compose.yml` to `12` again,
and run the following commands:
docker-compose up -d postgres # Start the database
docker-compose exec -T postgres psql -U pysite < db.sql # Pull in the dump
rm db.sql # Cleanup garbage, if you want
If you're on Windows, then I can't help you. Sorry.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Co-Authored-By: Johannes Christ <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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.
|
|
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
|
|
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|