Giter Club home page Giter Club logo

ddr-idservice's Introduction

ddr-idservice

Central registrar for DDR identifiers

ddr-idservice's People

Contributors

gjost avatar

Watchers

 avatar James Cloos avatar Geoff avatar

ddr-idservice's Issues

Upgrade to Django 1.11

Note: This is the last version to support Python 2..
Step towards updating to Python 3.
and Django 2.*.

ID request action generates new IDs but does not record them.

Archivist created entity ddr-densho-325-210 using ddr-local, entered metadata and added master/mezz binaries.
She then clicked "create new object" but the "new" object ID was ddr-densho-325-210 again.
All the fields were blank, no master/mezz files present in the web ui. Master/mezz files were present in the back end.
No error messages. Bug has been replicated following the above steps.

Looks like ID service is issuing new IDs but not adding them to its backend store.
That is, the service will continue to issue the same ID over and over again to the ddr-editor webui.
If ID is added manually through the webadmin, it will issue the next ID properly.

idservice should serve ddr-editor lowest unassigned integer ID

There is a use-case where IDs (usually for a collection) may be manually assigned. The next automatically assigned ID should always be the lowest possible integer value, rather than the next highest after the manually assigned series.

Example case:

  • ddr-testing-5 is created in the ddr-editor UI using the "Add new collection" button.
  • Collection IDs for ddr-testing-1000, ddr-testing-1001, and ddr-testing-1002 are added through the idservice admin interface.
  • The next collection created through the ddr-editor UI should be ddr-testing-6 (and not ddr-testing-1003)

(Looks like the current next logic is at: https://github.com/densho/ddr-idservice/blob/master/idservice/registrar/models.py#L165)

idservice issuing IDs for wrong collections

DDR editor user requested new ID in one collection but got an object in a totally different collection. The new ID is actually created in the idservice, and the new object is actually created in the other collection repo. Problem is accompanied by timeouts when requesting new IDs.

The pattern seems to be that shorter collection ID integers (cid) are acquiring extra digits.

For example:

  • User asks for new ID in ddr-densho-29, gets ID in ddr-densho-299.
  • ddr-densho-2 --> ddr-densho-229
  • ddr-densho-12 --> ddr-densho-129
  • ddr-densho-33 --> ddr-densho-333

Counterexamples:

  • ???

ObjectID.next not working with collections

IDservice is not returning IDs for new collections

idservice runserver
--------------------
[10/Aug/2017 13:50:20] "GET /api/0.1/rest-auth/user/ HTTP/1.0" 200 105
[10/Aug/2017 13:50:22] "POST /api/0.1/objectids/ddr-testing/next/collection/ HTTP/1.0" 500 27

idservice.log
--------------------
2017-08-10 13:50:22,016 DEBUG    [views.next_object]  next_object(<rest_framework.request.Request object at 0x7ff67957a950>, ddr-testing, collection)
2017-08-10 13:50:22,040 ERROR    [exception.handle_uncaught_exception]  Internal Server Error: /api/0.1/objectids/ddr-testing/next/collection/
Traceback (most recent call last):
  File "/usr/local/src/ddr-idservice/venv/idservice/local/lib/python2.7/site-packages/django/core/handlers/exception.py", line 42, in inner
    response = get_response(request)
  File "/usr/local/src/ddr-idservice/venv/idservice/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 249, in _legacy_get_response
    response = self._get_response(request)
  File "/usr/local/src/ddr-idservice/venv/idservice/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 187, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/usr/local/src/ddr-idservice/venv/idservice/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 185, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/usr/local/src/ddr-idservice/venv/idservice/local/lib/python2.7/site-packages/django/views/decorators/csrf.py", line 58, in wrapped_view
    return view_func(*args, **kwargs)
  File "/usr/local/src/ddr-idservice/venv/idservice/local/lib/python2.7/site-packages/django/views/generic/base.py", line 68, in view
    return self.dispatch(request, *args, **kwargs)
  File "/usr/local/src/ddr-idservice/venv/idservice/local/lib/python2.7/site-packages/rest_framework/views.py", line 483, in dispatch
    response = self.handle_exception(exc)
  File "/usr/local/src/ddr-idservice/venv/idservice/local/lib/python2.7/site-packages/rest_framework/views.py", line 443, in handle_exception
    self.raise_uncaught_exception(exc)
  File "/usr/local/src/ddr-idservice/venv/idservice/local/lib/python2.7/site-packages/rest_framework/views.py", line 480, in dispatch
    response = handler(request, *args, **kwargs)
  File "/usr/local/src/ddr-idservice/venv/idservice/local/lib/python2.7/site-packages/rest_framework/decorators.py", line 52, in handler
    return func(*args, **kwargs)
  File "/usr/local/src/ddr-idservice/idservice/registrar/views.py", line 90, in next_object
    next_object = ObjectID.next(oi, model)
  File "/usr/local/src/ddr-idservice/idservice/registrar/models.py", line 195, in next
    last = identifier.max_id(model, identifiers)
  File "/usr/local/src/ddr-idservice/venv/idservice/local/lib/python2.7/site-packages/ddr_cmdln-0.9.4b0-py2.7.egg/DDR/identifier.py", line 762, in max_id
    raise Exception('New id not in given list: %s' % oi)
Exception: New id not in given list: <DDR.identifier.Identifier collection:ddr-densho-40030>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.