Commit graph

59 commits

Author SHA1 Message Date
Jennifer Richards a338df16f2
fix: 404 instead of 300 for ambiguous email_or_person (#8004)
* fix: 404 on CommunityList name collision

* fix: 404 on ambiuous person for photo() view

* test: update tests

---------

Co-authored-by: Robert Sparks <rjsparks@nostrum.com>
2024-10-16 11:36:54 -05:00
Jennifer Richards 020bdeb058
feat: purge_personal_api_key_events() task (#7485)
* feat: purge_personal_api_key_events() task

* feat: log number of events purged

* test: test new task

* fix: name task properly

* chore: create daily PeriodicTask

* chore: remove old management command

* chore: remove tests of old command

* test: finish removing now-empty tests.py
2024-05-30 08:23:49 -05:00
Jennifer Richards d5009ee794
feat: discourage URLs in Person names (#7453)
* feat: disallow @ and : in name/ascii

@ has long been disallowed via validation in the
views and "/" has been disallowed for the name
field via a validator. This adds @ and : to the
validator and applies it to the name, plain,
ascii, and ascii_short fields. This should
apply everywhere we use a ModelForm.

* test: update test

* chore: migration
2024-05-22 17:23:27 -05:00
Robert Sparks d9cc26be96
feat: replace references to User with references to Person (#6024)
* refactor: change references from User to Person (#5821)

* refactor: Change CommunityList reference from User to Person

* refactor: Convert more user references to person

* refactor: Change augment_docs_and_user_with_user_info to person

* refactor: Change Nomination and Feedback references from User to Person

* refactor: Change a few test case function signatures to be more pythonic

* refactor: Harmonize how profile and photo views look up email_or_name

* refactor: Rework community views to operate on Person instead of User (#5859)

* test: Update tests to try all of the person's emails and aliases

* fix: Recode a test case to avoid an exception if there's Unicode in the URL

This only happens using the form-filling and submission feature of
WebTest, which is only used in this one test case, so just it rip out.

* test: Add duplicate-person tests

* fix: If there are multiple matching users, prefer the logged-in one.

* chore: We no longer use WebTest, so don't include it.

* fix: Address review comments

* fix: case-insensitive person name or email matching (#6096)

* chore: Renumber migrations

* fix: Update merged code so tests pass (#6887)

* fix: Use refactored method

* fix: Don't assume user has person

* fix: Use new view param name

* chore: Drop community lists w/o person; cleanup (#6896)

* fix: Don't assume user has person

* fix: user->person in update_community_list_index.py

* feat: Remove CommunityLists without Person

* refactor: Speed up nomcom migrations

---------

Co-authored-by: Paul Selkirk <paul@painless-security.com>
Co-authored-by: Jennifer Richards <jennifer@staff.ietf.org>
2024-01-24 11:00:19 -06:00
Rich Salz 9aea2a2e8b
fix: Make name/email lookups case-insensitive (#5972) (#6007)
* fix: Make name/email lookups case-insensitive (#5972)

Use icontains so that looking up name or email is case insensitive
Added a test

Fixes: 5972

* fix: Use __iexact not __icontains
2023-07-22 13:16:42 -07:00
Jennifer Richards 131cdf9943
fix: drop duplicate alias/email Person records from profile view (#4734)
* fix: drop duplicate alias/email Person records from profile view

* test: test de-duplication of Person records
2022-11-08 17:48:17 +00:00
Kesara Rathnayake 91170430ff
fix: Check both Person and Email records in profile view (#4703) 2022-11-05 17:48:31 +00:00
Jennifer Richards 69447d0ba0
Merge branch 'feat/tzaware' into jennifer/main-for-tzaware-merge
# Conflicts:
#	ietf/name/fixtures/names.json
#	ietf/utils/management/commands/send_gdpr_consent_request.py
2022-10-18 16:57:42 -03:00
Jennifer Richards fffe0c1991
feat: disallow '/' from Person.name (#4594)
* feat: disallow '/' from Person.name

* chore: migrate Person/HistoricalPerson to include new name validator

* test: test name validation
2022-10-17 15:41:39 -05:00
Jennifer Richards ebebdbed3e
refactor: replace datetime.now and datetime.today with timezone.now (#4211)
* refactor: replace datetime.now with timezone.now

* refactor: migrate model fields to use timezone.now as default

* refactor: replace datetime.today with timezone.now

datetime.datetime.today() is equivalent to datetime.datetime.now(); both
return a naive datetime with the current local time.

* refactor: rephrase datetime.now(tz) as timezone.now().astimezone(tz)

This is effectively the same, but is less likely to encourage accidental
use of naive datetimes.

* refactor: revert datetime.today() change to old migrations

* refactor: change a missed datetime.now to timezone.now

* chore: renumber timezone_now migration

* chore: renumber migrations
2022-08-25 13:45:16 -03:00
Robert Sparks 8b90ecd4aa
feat: add pronouns to Person and oidc claims. Fixes #4043. (#4059)
* feat: add pronouns

* fix: include migrations

* fix: correct daggers on person form.

* fix: clean pronouns

* feat: add choices to pronouns

* feat: show pronouns on public profile

* feat: add pronouns to oidc userinfo

* fix: move pronouns to new claim. Add tests.

* fix: improve html generated by new widget

* feat: use a MultiWidget for pronouns

* refactor: use two fields on Person for the two types of pronoun entry.

* chore: update copyrights
2022-06-21 15:02:02 -05:00
Lars Eggert ed30521e14 Many more HTML fixes.
- Legacy-Id: 19908
2022-02-03 07:49:34 +00:00
Lars Eggert cc723ce449 More fixes.
- Legacy-Id: 19899
2022-01-31 19:17:50 +00:00
Robert Sparks 41ddb37e01 Adjust dots claim based on 112 Plenary feedback
- Legacy-Id: 19544
2021-11-03 18:28:47 +00:00
Robert Sparks c906a8e654 Use a cdn for the oidc profile photo url. Commit ready for merge.
- Legacy-Id: 19176
2021-07-01 15:56:53 +00:00
Jennifer Richards 6cf9eb8dd1 Allow secretariat to edit document author list. Fixes #3185. Commit ready for merge.
- Legacy-Id: 18989
2021-05-11 18:40:28 +00:00
Ryan Cross 8da4caf30f Fix test for handle_reviewer_settings. Commit ready for merge
- Legacy-Id: 18878
2021-03-02 22:27:57 +00:00
Ryan Cross aca3b41445 Add special handling for ReviewerSettings to merge person feature. Fixes #3183. Commit ready for merge
- Legacy-Id: 18860
2021-02-23 21:03:16 +00:00
Robert Sparks 3697180cc1 Reverted merge of timezone-aware migration efforts.
- Legacy-Id: 18792
2021-01-12 16:54:20 +00:00
Henrik Levkowetz 774e752a54 Snapshot of timezone-aware datatracker code. Tests pass, and the test-crawler shows only expected differences. Trunk changes merged in up to r18768.
- Legacy-Id: 18770
2020-12-16 23:53:37 +00:00
Henrik Levkowetz 07be1f8516 Added a view to retrieve profile photos, in order to support Meetecho's need for such, at /person/{email}/photo. The default is to supply images with 80px width. Image scaling is available using the same query argument as Gravatar: ?size=200 or ?s=200 for 200-pixel wide images.
- Legacy-Id: 18483
2020-09-10 21:41:01 +00:00
Henrik Levkowetz c6cdbf8ca8 Added a new field Person.plain as a fallback for names where plain_name() produces the wrong result. Fixes issue #3020.
- Legacy-Id: 18147
2020-07-11 20:22:23 +00:00
Henrik Levkowetz 06fa5e517a Adjusted the code to the changed signature of admin.utils.get_deleted_objects()
- Legacy-Id: 18053
2020-06-24 20:39:27 +00:00
Henrik Levkowetz 726fcbf27d Removed all __future__ imports.
- Legacy-Id: 17391
2020-03-05 23:53:42 +00:00
Henrik Levkowetz e9a37d8ac8 Removed six.text_type(), changed six.moves.urllib to plain urllib, and removed now unused six imports.
- Legacy-Id: 17385
2020-03-05 14:41:41 +00:00
Henrik Levkowetz b14cba5f15 Refactored some document methods to align better with Django's get_absolute_url(), and added Person.get_absolute_uri()
- Legacy-Id: 17189
2020-01-07 13:33:02 +00:00
Henrik Levkowetz bdc73e771a Python2/3 compatibility: replaced six.ensure_text() with either six.text_type or django's force_text(), depending on the case, and fixed a variable scope issue.
- Legacy-Id: 16461
2019-07-16 13:20:05 +00:00
Henrik Levkowetz 8c6eb3a30a Python2/3 compatibility: Changed the use of open() and StringIO to io.open() etc.
- Legacy-Id: 16458
2019-07-15 19:14:04 +00:00
Henrik Levkowetz 0679eaa8d4 Removed unused imports.
- Legacy-Id: 16402
2019-07-04 21:06:57 +00:00
Henrik Levkowetz f480799af9 Undid unintentional bulk commit
- Legacy-Id: 16401
2019-07-04 21:04:46 +00:00
Henrik Levkowetz fc09a59950 Added decode() of command pipe output.
- Legacy-Id: 16400
2019-07-04 21:01:39 +00:00
Henrik Levkowetz 942fc7f907 Fixed a bad call argument to FeedbackFactory
- Legacy-Id: 16351
2019-07-01 12:01:02 +00:00
Henrik Levkowetz 05f275a3af Changed instances of json.loads(r.content) to r.json(). Changed some instances of assert* to assertContains.
- Legacy-Id: 16338
2019-06-30 20:44:45 +00:00
Henrik Levkowetz d7f5c84182 Initial 2to3 patch with added copyright statement updates.
- Legacy-Id: 16309
2019-06-27 14:40:54 +00:00
Henrik Levkowetz 9bfb488110 After having test_duplicate_person_name() fail for a non-ascii name, changed the test to always supply a non-ascii name.
- Legacy-Id: 16180
2019-05-01 21:34:59 +00:00
Robert Sparks 5c57cf1b91 Used factories instead of make_test_data for malinglists, mailtrigger, message, person, secr/announcement, and secr/areas tests. Commit ready for merge.
- Legacy-Id: 15551
2018-10-10 05:36:34 +00:00
Henrik Levkowetz 2522082979 Changed the email origin field during test to hold user.username in order to exercise more of the code. Changed the EmailFactory to also use user.username as origin.
- Legacy-Id: 15172
2018-05-26 08:32:20 +00:00
Henrik Levkowetz 5f37a71889 Added origin information to all places where we create email address entries.
- Legacy-Id: 15127
2018-05-05 12:40:30 +00:00
Ryan Cross 85f4861f9f Add view for merge person records. Commit ready for merge.
- Legacy-Id: 14862
2018-03-18 18:01:56 +00:00
Ryan Cross f0a4ff213f Backout premature commit of person/tests.py. Commit ready for merge
- Legacy-Id: 14846
2018-03-17 15:51:28 +00:00
Ryan Cross 01bfbff170 Remove unused roles/forms.py. Commit ready for merge
- Legacy-Id: 14845
2018-03-17 15:49:02 +00:00
Henrik Levkowetz c4954e13b1 Added more test objects in test_merge_users(), and fixed an issue with merge_users() uncovered by the added testing.
- Legacy-Id: 13730
2017-06-29 14:53:00 +00:00
Ryan Cross 7768e7c6b3 Improve User merge handling in merge_persons(). Fix minor bug in submit.checkers.py. Fixes #1900. Commit ready for merge.
- Legacy-Id: 13718
2017-06-26 23:13:58 +00:00
Ryan Cross e9b7c5753e Refactor ietf/bin/merge-person-records to facilitate testing. Add tests. Fixes #2162. Commit ready for merge.
- Legacy-Id: 13567
2017-06-08 23:28:43 +00:00
Lars Eggert 8a70e9773d Fix various "RemovedInDjango20Warning" warnings. Commit ready for merge.
- Legacy-Id: 13112
2017-03-25 19:16:45 +00:00
Henrik Levkowetz 5f053ad21a Cleaned up the remaining explicit url names, using dotted-paths to view
functions instead.  In all almost 700 changes.
 - Legacy-Id: 12923
2017-02-26 23:21:49 +00:00
Henrik Levkowetz 988a2b808f Added explicit charset setting and consistent encoding to several email paths through the datatracker. After introducing support for non-ascii names in email addresses, using role.formatted_email() to insert names into email content doesn't work any more, since uncode names will now be rfc2047-encoded in formatted_email(). Added another method role.name_and_email() for this case. Replaced another case of '%s <%s>' name-and-email formatting with formataddr(). Fixed some tests which did not send unicode email bodies to the email functions. Fixes issue #2017.
- Legacy-Id: 12896
2017-02-21 19:17:10 +00:00
Henrik Levkowetz 858d855eff Changed the new account creation to require a proper name at the same time as the account password is set, before actually creating the account. Also tweaked the password strength and confirmation code.
- Legacy-Id: 12892
2017-02-20 16:50:39 +00:00
Henrik Levkowetz 8930d29a8e Merged in Django-1.10 upgrade work from ^/personal/henrik/6.43.1-django-1.10
- Legacy-Id: 12881
2017-02-19 18:18:00 +00:00
Henrik Levkowetz cf4a4b02a7 Reworked the email address handling in order to be able to support non-ascii names as part of email address fields. Reworked the generation of user names in the test suite to generate names from multiple non-ascii locales. Fixes issue #2080.
- Legacy-Id: 12872
2017-02-18 21:50:18 +00:00