-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deployment #434
Merged
Deployment #434
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This helps distinguishing the purpose of the field from `User.email`. Also removed setting the (contact) email to the user's email when creating a Member object, as the user should be able to decide their own preferred contact email address instead of the code taking that choice for them. So if we don't have the contact email of a user, we should ask them instead of assuming.
Namely: * Gmail - for the Google services we use * MAKE email - this has previously not been visible to anyone, except on the G Suite admin page * NTNU starting semester - useful for getting an overview over when members are likely to finish their studies * GitHub username - useful for keeping track of which GitHub accounts belong to whom (especially in the cases where a member's GitHub profile does not contain any real name)
Also removed the `validators` default kwarg from the constructor of `modelfields.CardNumberField`, as it's not necessary when `default_validators` is defined.
The code is now simpler, it's now possible to focus on the "set language"-button using the "tab" key, and it looks slightly more stylish!
The `add_member` permission already exists (automatically generated by Django), so might as well use that one instead.
Also did the same with `ModelAdmin`s' `short_description`, and various other places where a "capped first" version of the lowercase `verbose_name`s were being used. For the latter case, `capfirst` was added - in both Python and template code, to not change how the templates are rendered. This change enables Django to selectively make the first letter of fields' `verbose_name` uppercase when rendering a template, depending on where the `verbose_name` is used; see the desccription of the convention here: https://docs.djangoproject.com/en/3.1/topics/db/models/#verbose-field-names. Another advantage of this is that it doesn't litter the translation file with upper- and lowercased versions of the same word.
Also improved the translation in `profile.html`.
A guide on the (upcoming) standard was found at https://securitytxt.org/.
Also renamed the files to match what they're testing, and simultaneously split `groups/tests.py` into fitting files. Also, removed the empty `users/tests.py`.
Also removed the `PermissionsTestCase` helper class, as it's now redundant.
Instead of `start_days` being an int where the 7 least significant bits represent the weekdays, it's now an array of ints, where each element is the index of the day it represents (Monday=1; Sunday=7). This makes it a lot easier to understand what the value stored in the database means, and it reduces the code necessary to convert between different representations.
Most validation should be done by the form, not the model.
Also added the `auto_now=True` attribute.
Also made some additional changes to complement this rather large change, like: * adding `help_text`s to some model fields (and migrations), * making the format of the form error messages consistent, * adding `CommitteeForm`, as it was needed to be able to easily specify widgets, * removing the validation logic in `quota_edit.html` (written in JavaScript), to let the form handle it instead, * moving the remaining JavaScript code from `quota_edit.html` to its own `.js` file, * renaming `event_type.js` to `event_edit.js`, to match the template name, * moving `news_base_edit.css` to be used directly by `SemanticFileInput` (and simultaneously renaming it to `semantic_file.css`), * making it so that the label of the multi-lingual text widget has its `for` attribute set to the text input in the active tab (which hopefully improves accessibility), * and cleaning up various translations.
Also changed `AboutUsView`'s `title` from being a field to being an argument in the `as_view()` call, to move it (locationally) closer to the view's `name` argument (which the title is supposed to match).
Also made MachineUsageRule's edit view use ContentBox' edit template.
Also added an internal URL for editing internal content boxes, which requires a permission that is separate from what is required for editing the public content boxes.
This will only be active if installed - either manually or through `requirements_dev.txt`.
Update to Django 4.0
Bumps [pillow](https://github.com/python-pillow/Pillow) from 9.0.1 to 9.1.0. - [Release notes](https://github.com/python-pillow/Pillow/releases) - [Changelog](https://github.com/python-pillow/Pillow/blob/main/CHANGES.rst) - [Commits](python-pillow/Pillow@9.0.1...9.1.0) --- updated-dependencies: - dependency-name: pillow dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
# Conflicts: # locale/nb/LC_MESSAGES/django.mo # locale/nb/LC_MESSAGES/django.po
* Renamed the quote paths and views to conform to the style guide
* Changed the ordering of the internal views; moved the secret and quote views to last in the file, to match the order of the internal models.
Now, users can delete and change quotes they've created, even if they don't have the `delete_quote` or `change_quote` permission. To complement this, the quote permissions should be set up so that all members have the add permission, but only privileged members have the delete and the "universal" change permission. Also, the permission checks in `quotes_list.html` are now equal to the ones in the quote views.
Also fixed an exception when searching, as it's not valid to include a foreign key field (`author`) in `search_fields`, without specifying fields on the related model using lookup syntax (double underscores). This is now done in `UserSearchFieldsMixin`.
Also added the `view_quote` permission to quote URLs.
⬆(deps): Bump pillow from 9.0.1 to 9.1.0
Bumps [phonenumbers](https://github.com/daviddrysdale/python-phonenumbers) from 8.12.45 to 8.12.46. - [Release notes](https://github.com/daviddrysdale/python-phonenumbers/releases) - [Commits](daviddrysdale/python-phonenumbers@v8.12.45...v8.12.46) --- updated-dependencies: - dependency-name: phonenumbers dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
…-8.12.46 ⬆(deps): Bump phonenumbers from 8.12.45 to 8.12.46
...to conform to the style guide.
Setting the default date to Jan. 1, 1970, should make it easier to find quotes that were added before the migration.
Removed `blank`, as the field is not nullable, and we should therefore require the user to provide a value - e.g. the initial value in the view. The latter is not strictly necessary, as the `SemanticDateInput` widget defaults to the current date if no initial value is provided, but setting the initial value is best practice nonetheless.
Add datefield to quotes
sigridge
approved these changes
Apr 4, 2022
Codecov Report
@@ Coverage Diff @@
## main #434 +/- ##
==========================================
+ Coverage 82.73% 88.59% +5.85%
==========================================
Files 118 134 +16
Lines 4200 5262 +1062
==========================================
+ Hits 3475 4662 +1187
+ Misses 725 600 -125
Continue to review full report at Codecov.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Brings in the changes from the following PRs:
Also the following automated PRs: