Make import_accomplishments "safer" and more efficient

Bug #1091886 reported by Janos Gyerik
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu Accomplishments Web Gallery
Fix Released
Medium
Janos Gyerik

Bug Description

Currently the import_accomplishments management command (./common/management/commands/import_accomplishments.py) practically re-imports even existing accomplishments. This is not very efficient, and a bit awkward too, as it does things like:
- re-add categories (first delete existing, then add categories, most of the time the same as before)
- re-add dependencies (first delete existing, then add dependencies, most of the time the same as before)

It would be better to check the timestamp of the accomplishment file before important, if it is the same as in the last import, then skip the file (do not re-import).

Please include appropriate unit tests in the branch, verifying that:
- new accomplishments (not yet imported) will be imported
- unchanged accomplishments (same timestamp as previous import) will be ignored
- updated accomplishments (newer timestamp than previous import) will be imported

Do not over-think or over-optimize this. After all, the current method works (it ain't broken, it's just not so great).

Changed in ubuntu-accomplishments-web:
assignee: nobody → Janos Gyerik (janos-gyerik)
Changed in ubuntu-accomplishments-web:
status: Confirmed → In Progress
Changed in ubuntu-accomplishments-web:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.