Resolve "dynamic_preferences.preferences.InvalidNameError: Sequence "__" is forbidden in section and preferences name, since it is used to access values via managers" #135

Merged
hansegucker merged 3 commits from 30-dynamic_preferences-preferences-invalidnameerror-sequence-__-is-forbidden-in-section-and into master 2021-09-15 21:53:41 +02:00
hansegucker commented 2021-09-05 15:32:06 +02:00 (Migrated from edugit.org)

Closes #30

Closes #30
hansegucker commented 2021-09-05 15:32:07 +02:00 (Migrated from edugit.org)

assigned to @hansegucker

assigned to @hansegucker
hansegucker commented 2021-09-05 15:38:32 +02:00 (Migrated from edugit.org)

added 1 commit

  • 6a2a2b69 - Use re to replace underscores in preference names

Compare with previous version

added 1 commit <ul><li>6a2a2b69 - Use re to replace underscores in preference names</li></ul> [Compare with previous version](/AlekSIS/official/AlekSIS-App-LDAP/-/merge_requests/78/diffs?diff_id=11528&start_sha=57f4005094a9d3ba04ac72d99d9fd53fe1a5ec0c)
hansegucker commented 2021-09-05 15:38:42 +02:00 (Migrated from edugit.org)

assigned to @nik and unassigned @hansegucker

assigned to @nik and unassigned @hansegucker
hansegucker commented 2021-09-05 15:38:42 +02:00 (Migrated from edugit.org)

marked this merge request as ready

marked this merge request as **ready**
hansegucker commented 2021-09-05 15:39:36 +02:00 (Migrated from edugit.org)

added 3 commits

  • 6a2a2b69...53022534 - 2 commits from branch master
  • 776f9167 - Merge branch 'master' into...

Compare with previous version

added 3 commits <ul><li>6a2a2b69...53022534 - 2 commits from branch <code>master</code></li><li>776f9167 - Merge branch &#39;master&#39; into...</li></ul> [Compare with previous version](/AlekSIS/official/AlekSIS-App-LDAP/-/merge_requests/78/diffs?diff_id=11530&start_sha=6a2a2b690c4dac9185d57f5a5d29b0682dcdb71d)
nik commented 2021-09-05 20:45:04 +02:00 (Migrated from edugit.org)

This change is invalid, because it produces name clashes. The . must not be replaced by a character sequence which is a valid part in a field name.

This change is invalid, because it produces name clashes. The `.` must not be replaced by a character sequence which is a valid part in a field name.
hansegucker commented 2021-09-05 20:46:57 +02:00 (Migrated from edugit.org)

But then it was already wrong?

But then it was already wrong?
nik commented 2021-09-05 21:02:27 +02:00 (Migrated from edugit.org)

Umm… maybe. But maybe not. Isn't __ invalid in field names as well? In that case, the function is entirely useless…

In any case, if we fix it, we should fix it for real.

Umm… maybe. But maybe not. Isn't `__` invalid in field names as well? In that case, the function is entirely useless… In any case, if we fix it, we should fix it for real.
hansegucker commented 2021-09-06 19:34:38 +02:00 (Migrated from edugit.org)

Isn't __ invalid in field names as well? In that case, the function is entirely useless…

It definitely occurs in field names, so it can't be invalid.

This change is invalid, because it produces name clashes.

Can you please give me an example for such a name clash?

> Isn't `__` invalid in field names as well? In that case, the function is entirely useless… It definitely occurs in field names, so it can't be invalid. > This change is invalid, because it produces name clashes. Can you please give me an example for such a name clash?
nik commented 2021-09-11 10:28:19 +02:00 (Migrated from edugit.org)

Yes, well, obviously…

foo__bar → foo_bar clashes with foo_bar → foo_bar

Yes, well, obviously… `foo__bar → foo_bar` clashes with `foo_bar → foo_bar`
nik commented 2021-09-11 10:30:57 +02:00 (Migrated from edugit.org)

Oh, and:

https://docs.djangoproject.com/en/3.2/topics/db/models/#field-name-restrictions

"A field name cannot contain more than one underscore in a row […]"

Where do we have a field name with more than one underscore in a row, in your opinion?

Oh, and: https://docs.djangoproject.com/en/3.2/topics/db/models/#field-name-restrictions "A field name cannot contain more than one underscore in a row […]" Where do we have a field name with more than one underscore in a row, in your opinion?
hansegucker commented 2021-09-14 17:51:30 +02:00 (Migrated from edugit.org)

changed this line in version 3 of the diff

changed this line in [version 3 of the diff](/AlekSIS/official/AlekSIS-App-LDAP/-/merge_requests/78/diffs?diff_id=11624&start_sha=776f9167c1042ded4b408950faae493c8b7a2b8a#c33d3bebee06aec596b3ba501d9b4cbb66047970_33_34)
hansegucker commented 2021-09-14 17:51:31 +02:00 (Migrated from edugit.org)

added 1 commit

  • a102cf5b - Add hash to preference names to prevent double names

Compare with previous version

added 1 commit <ul><li>a102cf5b - Add hash to preference names to prevent double names</li></ul> [Compare with previous version](/AlekSIS/official/AlekSIS-App-LDAP/-/merge_requests/78/diffs?diff_id=11624&start_sha=776f9167c1042ded4b408950faae493c8b7a2b8a)
hansegucker commented 2021-09-14 17:51:40 +02:00 (Migrated from edugit.org)

resolved all threads

resolved all threads
hansegucker commented 2021-09-14 17:51:51 +02:00 (Migrated from edugit.org)

@nik Can you please review again?

@nik Can you please review again?
nik commented 2021-09-14 20:23:30 +02:00 (Migrated from edugit.org)

name_without_underscores is a misleading name, give nthat this substitution's replacement character is an underscore.

`name_without_underscores` is a misleading name, give nthat this substitution's replacement character is an underscore.
nik commented 2021-09-14 20:24:10 +02:00 (Migrated from edugit.org)

This will produce an invalid name for fields ending in _ (e.g. key_)

This will produce an invalid name for fields ending in `_` (e.g. `key_`)
nik commented 2021-09-14 20:24:48 +02:00 (Migrated from edugit.org)

This needs a migration path from the old setting names!

This needs a migration path from the old setting names!
hansegucker commented 2021-09-14 21:32:59 +02:00 (Migrated from edugit.org)

changed this line in version 4 of the diff

changed this line in [version 4 of the diff](/AlekSIS/official/AlekSIS-App-LDAP/-/merge_requests/78/diffs?diff_id=11630&start_sha=a102cf5b5325dd1fa2f05fbce41fdb4dba077c07#c33d3bebee06aec596b3ba501d9b4cbb66047970_35_35)
hansegucker commented 2021-09-14 21:32:59 +02:00 (Migrated from edugit.org)

changed this line in version 4 of the diff

changed this line in [version 4 of the diff](/AlekSIS/official/AlekSIS-App-LDAP/-/merge_requests/78/diffs?diff_id=11630&start_sha=a102cf5b5325dd1fa2f05fbce41fdb4dba077c07#c33d3bebee06aec596b3ba501d9b4cbb66047970_36_35)
hansegucker commented 2021-09-14 21:32:59 +02:00 (Migrated from edugit.org)

added 1 commit

  • 7781cbea - Add hash to preference names to prevent double names

Compare with previous version

added 1 commit <ul><li>7781cbea - Add hash to preference names to prevent double names</li></ul> [Compare with previous version](/AlekSIS/official/AlekSIS-App-LDAP/-/merge_requests/78/diffs?diff_id=11630&start_sha=a102cf5b5325dd1fa2f05fbce41fdb4dba077c07)
nik commented 2021-09-14 21:38:20 +02:00 (Migrated from edugit.org)

Please choose a better name. I was always thinking of preficēs reading this abbreviated name, and then found it to be sufficēs ;)

Please choose a better name. I was always thinking of `preficēs` reading this abbreviated name, and then found it to be sufficēs ;)
hansegucker commented 2021-09-15 16:52:50 +02:00 (Migrated from edugit.org)

resolved all threads

resolved all threads
hansegucker commented 2021-09-15 16:52:52 +02:00 (Migrated from edugit.org)

changed this line in version 5 of the diff

changed this line in [version 5 of the diff](/AlekSIS/official/AlekSIS-App-LDAP/-/merge_requests/78/diffs?diff_id=11642&start_sha=7781cbea782f873fa417233a20d38e7801f900f5#2bfb3051c9f9f269ee14db2cf6667bd845a2352e_7_7)
hansegucker commented 2021-09-15 16:52:52 +02:00 (Migrated from edugit.org)

added 1 commit

  • 1459327b - Add hash to preference names to prevent double names

Compare with previous version

added 1 commit <ul><li>1459327b - Add hash to preference names to prevent double names</li></ul> [Compare with previous version](/AlekSIS/official/AlekSIS-App-LDAP/-/merge_requests/78/diffs?diff_id=11642&start_sha=7781cbea782f873fa417233a20d38e7801f900f5)
hansegucker commented 2021-09-15 16:53:35 +02:00 (Migrated from edugit.org)

@nik I tested the migration and it worked fine. So, please review again and then merge.

@nik I tested the migration and it worked fine. So, please review again and then merge.
nik commented 2021-09-15 21:53:41 +02:00 (Migrated from edugit.org)

mentioned in commit f7ea0c24a7

mentioned in commit f7ea0c24a742368cd075aa4c7f2b67a3f7288e82
nik (Migrated from edugit.org) merged commit f7ea0c24a7 into master 2021-09-15 21:53:41 +02:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
aleksis/AlekSIS-App-LDAP!135
No description provided.