Skip to content

Importer improvements (part 3)#2592

Merged
janno42 merged 4 commits intoe-valuation:mainfrom
janno42:importer-3
Dec 30, 2025
Merged

Importer improvements (part 3)#2592
janno42 merged 4 commits intoe-valuation:mainfrom
janno42:importer-3

Conversation

@janno42
Copy link
Copy Markdown
Member

@janno42 janno42 commented Dec 16, 2025

see commit messages for details

Copy link
Copy Markdown
Member

@niklasmohrin niklasmohrin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense, some remarks:

Comment thread evap/contributor/forms.py Outdated
Comment thread evap/contributor/views.py Outdated
"editable": True,
"preview_html": preview_html,
"questionnaires_with_answers_per_contributor": {},
"show_participant_cms_info": evaluation.exam_type is not None and evaluation.cms_id is not None,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we keep this decision in the form? Maybe we could set something like self.fields["particpants"].cms_disclaimer = _(...) and pick this up in the view?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

even better would be if such an attribute would be included in our typing somehow, then we could also move the whole show-or-collapsed business to that.

not for this PR though, I am fine if we just keep the field specific things close to the field

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

adding attributes to fields is tricky, i now added it to the form. does that work for you?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of curiosity: What makes it tricky? I would have expected

self.fields["participants"].evap_participants_set_by_cms = True

to just work (apart from typechecking -> we can either ignore it, or add the four lines to have the custom field class with the attribute defined visibly for mypy).

I would also very much prefer to have this stored in the field, if possible just as a bool, with the translated string being added in the template.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i tried setting it for the field directly but field.cms_disclaimer is empty

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, we can merge as-is then from my side, I'd look into why it's not working or if we can find a better solution in the next days.

Comment thread evap/staff/importers/json.py
Comment thread evap/staff/importers/json.py
Copy link
Copy Markdown
Member

@richardebeling richardebeling left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm after the field/cms_disclaimer member discussion is resolved

Comment thread evap/staff/importers/json.py
@janno42 janno42 merged commit 93121f7 into e-valuation:main Dec 30, 2025
14 of 15 checks passed
@janno42 janno42 deleted the importer-3 branch December 30, 2025 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants