Skip to content
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
merged 195 commits into from
Apr 4, 2022
Merged

Deployment #434

merged 195 commits into from
Apr 4, 2022

Conversation

ddabble added 30 commits April 23, 2021 16:30
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.
ddabble and others added 26 commits March 29, 2022 11:44
This will only be active if installed - either manually or through `requirements_dev.txt`.
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.
@codecov
Copy link

codecov bot commented Apr 4, 2022

Codecov Report

Merging #434 (f76dcda) into main (599a393) will increase coverage by 5.85%.
The diff coverage is 92.72%.

@@            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     
Impacted Files Coverage Δ
make_queue/tests/utility.py 100.00% <ø> (ø)
make_queue/urls.py 100.00% <ø> (ø)
makerspace/urls.py 100.00% <ø> (ø)
checkin/views.py 40.82% <25.00%> (+4.90%) ⬆️
card/views.py 54.16% <33.33%> (+4.16%) ⬆️
internal/signals.py 46.66% <46.66%> (ø)
make_queue/views/admin/course.py 55.84% <50.00%> (-0.74%) ⬇️
docs/forms.py 62.50% <52.00%> (-14.43%) ⬇️
dataporten/ldap_utils.py 67.44% <63.33%> (+19.16%) ⬆️
internal/templatetags/member.py 91.66% <66.66%> (+0.36%) ⬆️
... and 116 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 599a393...f76dcda. Read the comment docs.

@sigridge sigridge merged commit fda92e0 into main Apr 4, 2022
@ddabble ddabble added the deployment Pull requests from another branch (usually `dev`) into the `main` branch label Apr 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deployment Pull requests from another branch (usually `dev`) into the `main` branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants