aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeLines
* Instantiate test_reminders module; implement UnauthedReminderAPITestsGravatar bendiller2020-01-07-0/+27
|
* Add 1em bottom margin to wiki markdown codeblocks.Gravatar scragly2019-12-09-0/+5
| | | | | Any text following the end of a codeblock in the wiki would very closely hug the codeblock, impacting readability and giving poor structure to page content. This adds in an appropriate margin to the bottom of codeblocks to give a fair buffer that matches typical paragraph spacing.
* Merge pull request #313 from python-discord/fix-discord-tosGravatar Sebastiaan Zeeff2019-11-20-1/+1
|\ | | | | Correct the Discord TOS link in rules API endpoint.
| * Correct the discord tos link in rules endpoint.Gravatar scragly2019-11-20-1/+1
|/
* Add pipenv run start command (#308)Gravatar scragly2019-11-12-0/+1
|\ | | | | Add pipenv run start command
| * Add the `--debug` flag to the start commandGravatar Matteo Bertucci2019-11-12-1/+1
| |
| * Add pipenv run start commandGravatar Akarys422019-11-11-0/+1
|/
* Merge pull request #292 from python-discord/allauth-user-settingsGravatar scragly2019-11-11-34/+1052
|\ | | | | Allauth improvements & GH
| * Merge branch 'master' into allauth-user-settingsGravatar scragly2019-11-11-49/+1123
| |\ | |/ |/|
* | Merge pull request #278 from python-discord/active-infractions-validationGravatar Sebastiaan Zeeff2019-11-03-4/+1069
|\ \ | | | | | | Validation for active infractions
| * | Resolve migration merge conflictsGravatar Sebastiaan Zeeff2019-11-03-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | Since other pull requests were merged that also included migrations for the API app, this PR needed to be updated to avoid conflicts in the migration history. In addition, the test files contained names of specific migration files that needed to be updated to the correct names after the merge resolution.
| * | Merge branch 'master' into active-infractions-validationGravatar Sebastiaan Zeeff2019-11-03-82/+106
| |\ \ | |/ / |/| |
* | | Merge pull request #293 from python-discord/update-dependency-pinningGravatar Leon Sandøy2019-10-28-45/+54
|\ \ \ | | | | | | | | Update dependency pinning
| * \ \ Merge branch 'master' into update-dependency-pinningGravatar Leon Sandøy2019-10-28-37/+52
| |\ \ \ | |/ / / |/| | |
| * | | Update dependency pinningGravatar sco12019-10-20-45/+54
| | | |
| | * | Make test less fragile and improve test nameGravatar Sebastiaan Zeeff2019-10-19-5/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `test_returns_400_for_active_infractions_of_type_that_cannot_be_ active` test relied on the order in which the validation was done since it contained incompatible combinations of arguments. The test has been changed to make sure the data is valid except for the thing we actually want to test. I have also tried to improve the name of the test that tests the `test_unique_constraint_accepts_active_infraction_after_inactive_ infraction` test. It now includes the logic of what it does, but not the entire name of the test it's testing.
| | * | Fix indentation and missing word in docstringGravatar Sebastiaan Zeeff2019-10-19-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The last two lines in the docstring of `InfractionFactory` in the `test_active_infraction_migration.py` file were overindented by one space. I've removed the space. The docstring of the `test_loader_build_graph_gets_called_once` method in the `MigrationsTestCaseNoSideEffectsTests` calss of the `test_base.py` file was missing two words. Corrected.
| | * | Apply feedback for pull request #278Gravatar Sebastiaan Zeeff2019-10-19-273/+373
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://github.com/python-discord/site/pull/278 This commit applies the feedback given to PR #278. I have made a number of significant changes: - I have added tests for the `MigrationsTestCase` class, including a test to see if the test case travels to the specified points in the migration history. - The dictionary of infracted users in the active migration tests now uses informative strings as keys. This makes it easier to relate a specific test to the data it's testing. - I have simplified the migration query logic by replacing unneeded Q objects by simpler keyword arguments to `filter` method calls. - I have removed the custom validation logic for allowing only one active infraction of a given type per user and replaced it by a `UniqueTogetherValidator` with a custom validation error message. - `test_unique_constraint_accepts_active_infraction_after_inactive_ infraction` relied on an Error results instead of a Fail result to indicate an issue with the database constraint. Since a fail should lead to a Fail status, I've replaced it by a try-except block that signals a test failure if an `IntegrityError` was caught by it.
| | * | Solve migration conflict by renaming migrationsGravatar Sebastiaan Zeeff2019-10-18-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| | * | Merge branch 'master' into active-infractions-validationGravatar Sebastiaan Zeeff2019-10-18-124/+1389
| | |\ \ | | |/ / | |/| |
| | * | 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
| | | * Merge branch 'master' into allauth-user-settingsGravatar Gareth Coles2019-10-28-35/+50
| | | |\ | |_|_|/ |/| | |
* | | | Merge pull request #301 from python-discord/new-rulesGravatar scragly2019-10-26-32/+18
|\ \ \ \ | | | | | | | | | | Add new rules.
| * | | | Add new rules.Gravatar scragly2019-10-26-32/+18
|/ / / /
* | | | Merge pull request #294 from bsoyka/patch-1Gravatar Sebastiaan Zeeff2019-10-25-2/+2
|\ \ \ \ | | | | | | | | | | Remove breadcrumb truncation
| * \ \ \ Merge branch 'master' into patch-1Gravatar Sebastiaan Zeeff2019-10-25-3/+32
| |\ \ \ \ | |/ / / / |/| | | |
* | | | | Merge pull request #288 from python-discord/bot#466-reminder-jump_urlGravatar Sebastiaan Zeeff2019-10-25-1/+30
|\ \ \ \ \ | | | | | | | | | | | | Add a jump_url field to the reminder model
| * \ \ \ \ Merge branch 'master' into bot#466-reminder-jump_urlGravatar Sebastiaan Zeeff2019-10-25-2/+2
| |\ \ \ \ \ | |/ / / / / |/| | | | |
| * | | | | Add migrations for the reminder modelGravatar Akarys422019-10-21-0/+19
| | | | | |
| * | | | | Change reminder.jump_url field to URLFieldGravatar Akarys422019-10-21-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | This make sure that the data receivied is valid
| * | | | | Add max_lengh for reminder.jump_urlGravatar Akarys422019-10-19-0/+1
| | | | | |
| * | | | | Add a jump-url field in the reminder modelGravatar Akarys422019-10-19-1/+10
| | |/ / / | |/| | |
| | * | | Remove breadcrumb truncationGravatar Benjamin Soyka2019-10-20-2/+2
| |/ / / | | | | | | | | As per discussion in #meta
| | | * Merge branch 'master' into allauth-user-settingsGravatar Gareth Coles2019-10-23-1/+1
| | | |\ | |_|_|/ |/| | |
* | | | Merge pull request #297 from python-discord/constant-debug-secret-keyGravatar Mark2019-10-22-1/+1
|\ \ \ \ | | | | | | | | | | Set SECRET_KEY to a constant in DEBUG mode
| * | | | Set SECRET_KEY to constant in debug modeGravatar Sebastiaan Zeeff2019-10-22-1/+1
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| | | * Full coverage and finish cleanupGravatar Gareth Coles2019-10-23-5/+96
| | | |
| | | * Add user settings modal, with connections management and account deletionGravatar Gareth Coles2019-10-23-13/+310
| | | |
| | | * Add role mapping migration I forgot to commitGravatar Gareth Coles2019-10-23-0/+18
| | | |
| | | * Finalize orange and purple custom coloursGravatar Gareth Coles2019-10-22-3/+3
| | | |
| | | * New colours, as discussed on DiscordGravatar Gareth Coles2019-10-22-7/+7
| | | |
| | | * Full test coverage, better redirect testingGravatar Gareth Coles2019-10-22-4/+110
| | | |
| | | * Prevent user signup when they've never joined+verifiedGravatar Gareth Coles2019-10-22-13/+110
| | | |
| | | * Merge branch 'master' into allauth-user-settingsGravatar Gareth Coles2019-10-22-1/+1
| | | |\ | |_|_|/ |/| | |
* | | | Add bulma content class to home page content for proper formatti… (#291)Gravatar scragly2019-10-23-1/+1
|\ \ \ \ | | | | | | | | | | Add bulma content class to home page content for proper formatting.
| * | | | Add bulma content class to home page content for proper formatting.Gravatar scragly2019-10-21-1/+1
| |/ / /
| | | * Implement account deletion at /accounts/deleteGravatar Gareth Coles2019-10-22-3/+76
| | | |
| | | * Merge branch 'master' into allauth-user-settingsGravatar Gareth Coles2019-10-22-0/+0
| | | |\ | |_|_|/ |/| | |