Skip to content

Add lastModified attribute to DSpaceObject#61

Merged
kshepherd merged 1 commit intothe-library-code:mainfrom
MITLibraries:pass-lastmodified-attribute
Feb 27, 2026
Merged

Add lastModified attribute to DSpaceObject#61
kshepherd merged 1 commit intothe-library-code:mainfrom
MITLibraries:pass-lastmodified-attribute

Conversation

@ehanson8
Copy link
Contributor

As we incorporate dspace-rest-python into our DSpace submission workflows, I discovered that the lastModified attribute did not exist in the Item instance after it was successfully created in DSpace. This was fixed by a simple addition to the DSpaceObject class.

To confirm this change didn't create issues with update_item since lastModified can't be modified except by DSpace itself, I successfully called update_item with a newly created Item instance where the lastModified attribute was set. This was possible because update_dso (which is called by update_item) removes the attribute with this block.

Happy to do any further testing to confirm this doesn't break anything, thanks!

* Add check for lastModified attribute in DSpaceObject.__init__ method to pass the attribute to child classes
@kshepherd
Copy link
Collaborator

Thanks @ehanson8 this looks perfect! I will look to release a new version soon so this change can be included.

Copy link
Collaborator

@kshepherd kshepherd left a comment

Choose a reason for hiding this comment

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

+1 small obvious fix

@kshepherd kshepherd merged commit 851be90 into the-library-code:main Feb 27, 2026
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