Skip to content

Comments

Fix an issue with adding and updating users when the accomodation_time_factor is not set.#2911

Open
drgrice1 wants to merge 1 commit intoopenwebwork:developfrom
drgrice1:bugfix/add-user-accomodation-time-factor
Open

Fix an issue with adding and updating users when the accomodation_time_factor is not set.#2911
drgrice1 wants to merge 1 commit intoopenwebwork:developfrom
drgrice1:bugfix/add-user-accomodation-time-factor

Conversation

@drgrice1
Copy link
Member

@drgrice1 drgrice1 commented Feb 12, 2026

The gen_new method is not sufficient to create the new method for database tables with default values for columns. So the newUser method needs to be created manually and make sure the default is set.

This was reported in issue #2910, and fixes that issue and most likely other places where users are added or updated without explicitly setting the accomodation_time_factor.

@drgrice1 drgrice1 force-pushed the bugfix/add-user-accomodation-time-factor branch 2 times, most recently from f91e739 to 44e2c49 Compare February 16, 2026 22:39
@drgrice1 drgrice1 changed the title Fix an issue with adding users when the accomodation_time_factor is n… Fix an issue with adding and updaing users when the accomodation_time_factor is not set. Feb 16, 2026
@drgrice1
Copy link
Member Author

I had to change this further. Not only the addUser method is affected. Generally, anytime a database user object is obtained with the newUser method there can be issues if that is used to add or update a user. So that method needs to be overridden to ensure the default is set. This is the same approach I used for the LTI launch data and the session in the key table. I should have realized this was needed before.

@dlglin dlglin changed the title Fix an issue with adding and updaing users when the accomodation_time_factor is not set. Fix an issue with adding and updating users when the accomodation_time_factor is not set. Feb 17, 2026
…_factor is not set.

The `gen_new` method is not sufficient to create the new method for
database tables with default values for columns.  So the `newUser`
method needs to be created manually and make sure the default is set.

This was reported in issue openwebwork#2910, and fixes that issue and most likely
other places where users are added or updated without explicitly setting
the `accomodation_time_factor`.
@drgrice1 drgrice1 force-pushed the bugfix/add-user-accomodation-time-factor branch from 44e2c49 to 490e7ab Compare February 17, 2026 21:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants