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

MBS-9885: Prevent setting end date for character artist #3402

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

reosarevok
Copy link
Member

@reosarevok reosarevok commented Oct 31, 2024

Implement MBS-9885

Problem

The guidelines say that characters should never have an end date, since a character can always be reused forever once created. But nothing currently stops users from entering end dates (and areas) for characters.

Solution

This restricts end dates and areas for characters in the same way as we already do for genders on groups.

On selecting character, this just blanks and hides the end date/area fields (including ended) rather than disabling them, since disabled fields would not actually remove dates if they were already present.

Testing

Manually, plus added tests similar to the ones we have for group genders.

Draft progress

  • Merge code needs to be written, using the same dropped_columns mechanism we already use for gender vs groups.
    • Need to decide how to display this. Group vs gender shows the specific type and/or gender being dropped in the edit note. For end date stuff there's more than one field, should we have a note for end area and one for end date, specifying the details, or a generic one saying end area and/or end date was dropped with no details?
  • A constraint needs to be added, similar to group_type_implies_null_gender, blocking characters from having any of end_date_year, end_date_month, end_date_day, ended and end_area.

We changed this for sidebar display for Created a while ago, but I missed
the artist editor, and area should use Created in for consistency.
@reosarevok reosarevok force-pushed the MBS-9885 branch 2 times, most recently from 04bd606 to 3cb0b5d Compare October 31, 2024 16:18
The guidelines say that characters should never have an end date,
since a character can always be reused forever once created.

As such, this restricts end dates and areas for characters in the same way
as we already do for genders on groups.

On selecting character, this just blanks and hides the end date/area
fields (including ended) rather than disabling them, since disabled fields
would not actually remove dates
if they were already present.

Merge code and a db-level constraint will be added in subsequent commits.
Characters should never have an end date or area; this just enforces it
at the database level like we do with group genders.
The way this currently works causes issues with functions like comma_list
(because it inserts an unwanted message even if none is passed)
and with attempts to call it recursively on its own arguments
(such as a localized_note containing additional levels of localized_note
variables).
@reosarevok reosarevok changed the title [WIP] MBS-9885: Prevent setting end date for character artist MBS-9885: Prevent setting end date for character artist Nov 5, 2024
@reosarevok reosarevok marked this pull request as ready for review November 5, 2024 21:00
The guidelines say that characters should never have an end date,
since a character can always be reused forever once created.

As such, this restricts end dates and areas for characters when merging
in the same way as we already do for genders on groups.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
New feature Non urgent new stuff
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant