| Commit message (Collapse) | Author | Age | Lines | 
| ...                |  | 
| | | | | | | | | | 
| | | | | | | | | 
| | | | | | | | | 
| | | | | | | | | 
| | | | | | | | | 
| | | | | | | | | 
| | | | | | | | | 
| | | | | | | | | 
| | | | | | | | | 
| | | | | | | | | 
| | | | | | | | | 
| | | | | | | | | 
| | | | | | | | | 
| | | | | | | | | 
| | | | | | | | | 
| | | | | | | | | 
| | | | | | | | | 
| | | | | | | | | 
| | | | | | | | | 
| | | | | | | | | 
| | | | | | | | | 
| | | | | | | | | 
| | | | | | | | | 
| | | | | | | | |  | 
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
 | 
| | | | |\ \ \ \ \ \   | 
 | 
| | | | |\ \ \ \ \ \ \   | 
 | 
| | | | | | | | | | | |  | 
 | 
| | | | | | | | | | | |  | 
 | 
| | | | | | | | | | | |  | 
 | 
| | | | | | | | | | | |  | 
 | 
| | | | | | | | | | | |  | 
 | 
| | | | | | | | | | | |  | 
 | 
| | | | | | | | | | | |  | 
 | 
| | | | |\ \ \ \ \ \ \ \   | 
 | 
| | | | | | | | | | | | |  | 
 | 
| | | | |\ \ \ \ \ \ \ \ \  
| | | | | |_|_|/ / / / /  
| | | | |/| | | | | | |    | 
 | 
| | | | | | | | | | | | | 
| | | | | | | | | | | | 
| | | | | | | | | | | | 
| | | | | | | | | | | |  | 
This sets both the Django User's `username` and `first_name` params.
 | 
| | | | | | | | | | | | |  | 
 | 
| | | | | | | | | | | | |  | 
 | 
| | | | | | | | | | | | |  | 
 | 
| | | | | | | | | | | | |  | 
 | 
| | | | | | | | | | | | |  | 
 | 
| | | | | | | | | | | | |  | 
 | 
| | | | | | | | | | | | |  | 
 | 
| | | |/ / / / / / / / /   | 
 | 
| | | | | | | | | | | |  | 
 | 
| | | | | | | | | | | |  | 
 | 
| | | | | | | | | | | |  | 
 | 
| | | | | | | | | | |\ \  
| |_|_|_|_|_|_|_|_|/ /  
|/| | | | | | | | | |    | 
 | 
| | | | | | | | | |/ /   | 
 | 
| | | | | | | | | | |  | 
 | 
| | | | | | | | | | |  | 
 | 
| | | | | | | | | | |  | 
 | 
| | | | | | | | |/ /   | 
 | 
| | |_|_|_|_|_|_|/  
|/| | | | | | |   
| | | | | | | |   
| | | | | | | |   
| | | | | | | |   
| | | | | | | |   
| | | | | | | |   
| | | | | | | |   
| | | | | | | |   
| | | | | | | |   
| | | | | | | |   
| | | | | | | |   
| | | | | | | |   
| | | | | | | |   
| | | | | | | |   
| | | | | | | |   
| | | | | | | |    | 
https://github.com/python-discord/site/issues/302
This commit makes newlines in deleted messages visible in the deleted
messages front-end and makes sure they are not stripped during the
conversion to HTML. To represent newlines, I've chosen a commonly
used symbol: `↵`.
In addition, I've kaizened the colour filter that translates integer
representations of colours to their RGB hex-value. The Discord dark
theme shows black colours (int: 0; hex: #000000) as white instead, to
make reading them against the dark background easier. This commit
makes sure our front-end displays the same behavior.
This closes #302
 | 
| |\ \ \ \ \ \ \ \  
| |_|_|_|_|_|/ /  
|/| | | | | | |    | 
Update dependency pinning
 | 
| | |\ \ \ \ \ \ \  
| |/ / / / / / /  
|/| | | | | | |    | 
 | 
| |\ \ \ \ \ \ \ \  
| |_|_|_|_|_|_|/  
|/| | | | | | |    | 
Add new rules.
 | 
| |/ / / / / / /   | 
 | 
| |\ \ \ \ \ \ \  
| | | | | | | | 
| | | | | | | |  | 
Remove breadcrumb truncation
 | 
| | |\ \ \ \ \ \ \  
| |/ / / / / / /  
|/| | | | | | |    | 
 | 
| |\ \ \ \ \ \ \ \  
| |_|_|_|_|_|_|/  
|/| | | | | | |    | 
Add a jump_url field to the reminder model
 | 
| | |\ \ \ \ \ \ \  
| |/ / / / / / /  
|/| | | | | | |    | 
 | 
| |\ \ \ \ \ \ \ \  
| |_|_|_|_|_|_|/  
|/| | | | | | |    | 
Set SECRET_KEY to a constant in DEBUG mode
 | 
| |/ / / / / / /  
| | | | | | |   
| | | | | | |   
| | | | | | |   
| | | | | | |   
| | | | | | |   
| | | | | | |   
| | | | | | |   
| | | | | | |   
| | | | | | |   
| | | | | | |    | 
The SECRET_KEY in debug mode was auto-generated each time the config
file was loaded. This had the unwanted side-effect of requiring
testers to login again on the site as the SECRET_KEY had changed
during the reload process.
This commit resolves that by turning it into a constant. Since having
a constant secret results in the linting error `S105`, I have added a
specific `noqa` ignore for that.
 | 
| |\ \ \ \ \ \ \  
| |_|_|_|_|_|/  
|/| | | | | |    | 
Add bulma content class to home page content for proper formatting.
 | 
| | | |_|_|_|/  
| |/| | | |    | 
 | 
| |/ / / / /   | 
 | 
| | | | | |  | 
 | 
| | | | | | 
| | | | | 
| | | | | 
| | | | |  | 
This make sure that the data receivied is valid
 | 
| | | | | |  | 
 | 
| |/ / / /   | 
 |