Skip to content

Commit

Permalink
Story/vgnwb 233 (#132)
Browse files Browse the repository at this point in the history
* [VGNWB-219] moved type id to settings. Allowed them to be configurable through export statements and added default values.

* [VGNWB-219] updated ready

* [VGNWB-219] removed import settings

* [VGNWB-219] removed import and changed lifecycle to concept

* [VGNWB-219] updated concept type

* [VGNWB-210] added code to allow filters to stay applied when going between pages. Also added code to cleanup url

* [VGNWB-210] fixed filter resets when switching pages and added a bottom previous button

* [VGNWB-210] fixed previous button and set debug back to False

* [VGNWB-210] updated annotations view and template in in order to fix loss of filter state.

* [VGNWB-210] removed unnecessary js file and script tag, plus unused imports

* [VGNWB-207] added filter to filter out duplicate identities

* [VGNWB-223]Fixed concept filter from resetting.

* [VGNWB-223] removed unused files.

* [VGNWB-223] removed unused files.

* [VGNWB-223] removed unused files.

* [VGNWB-223] removed unused div.

* [VGNWB-223] fixed indentation.

* [VGNWB-223] removed trailing comma.

* [VGNWB-223] fixed id

* [VGNWB-223] removed print statements and combined else if into elif.

* [VGNWB-226] fixed scroll issue

* [VGNWB-226] removed print statement and trailing slash.

* [VGNWB-226] Update css.

* [VGNWB-233] added embargo time to submit relationship to quadriga.

* [VGNWB-233] reverted back celery beat schedule time to 600.

* [VGNWB-233] added six version

* [VGNWB-233] updated psycopg2 version

* [VGNWB-223] updated celery wait to use timedelta.

* [VGNWB-233] Changed days from 24 to 3 and re-added requirements.

* [VGNWB-233] fixed build error.

* [VGNWB-233] removed unneeded requirements.

* [VGNWB-233] removed unneeded requirements.
  • Loading branch information
tjquinn1 authored and jdamerow committed Mar 16, 2018
1 parent 8682c49 commit ac25a58
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 15 deletions.
23 changes: 13 additions & 10 deletions annotations/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
from django.contrib.contenttypes.models import ContentType

import requests, uuid, re
from datetime import datetime, timedelta
from django.utils import timezone
from itertools import groupby, chain
from collections import defaultdict

Expand Down Expand Up @@ -235,16 +237,17 @@ def accession_ready_relationsets():
relationsets = defaultdict(lambda: defaultdict(list))

for relationset in qs:
relationsets[relationset.occursIn.id][relationset.createdBy.id].append(relationset)
for text_id, text_rsets in relationsets.iteritems():
for user_id, user_rsets in text_rsets.iteritems():

# Update state.
def _state(obj):
obj.pending = True
obj.save()
map(_state, user_rsets)
submit_relationsets_to_quadriga.delay(map(lambda o: o.id, user_rsets), text_id, user_id, **kwargs)
timeCreated = relationset.created
if timeCreated + timedelta(days=settings.SUBMIT_WAIT_TIME['days'], hours=settings.SUBMIT_WAIT_TIME['hours'], minutes=settings.SUBMIT_WAIT_TIME['minutes']) < datetime.now(timezone.utc):
relationsets[relationset.occursIn.id][relationset.createdBy.id].append(relationset)
for text_id, text_rsets in relationsets.iteritems():
for user_id, user_rsets in text_rsets.iteritems():
# Update state.
def _state(obj):
obj.pending = True
obj.save()
map(_state, user_rsets)
submit_relationsets_to_quadriga.delay(map(lambda o: o.id, user_rsets), text_id, user_id, **kwargs)


# TODO: this should be retired.
Expand Down
Binary file modified celerybeat-schedule.db
Binary file not shown.
9 changes: 5 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ anyjson==0.3.3
black-goat-client==0.2.6
bleach==1.4.2
celery==3.1.25
certifi==2018.1.18
chardet==3.0.4
conceptpower-api==1.9
dicttoxml==1.6.6
dj-database-url==0.3.0
dj-static==0.0.6
Django==1.10.6
Expand Down Expand Up @@ -34,10 +37,8 @@ pytz==2016.10
redis==2.10.3
requests==2.13.0
requests-oauthlib==0.5.0
restable>=0.1.3
restable==0.1.3
six==1.10.0
Unidecode==0.4.20
urllib3==1.19.1
xmltodict==0.10.2
dicttoxml==1.6.6
six==1.10.0

8 changes: 7 additions & 1 deletion vogon/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@
CELERYBEAT_SCHEDULE = {
'accession_ready_relationsets': {
'task': 'annotations.tasks.accession_ready_relationsets',
'schedule': timedelta(seconds=600),
'schedule': timedelta(minutes=10,seconds=0),
},
}

Expand Down Expand Up @@ -257,3 +257,9 @@
'viaf:corporate': CORPORATE_CONCEPT_TYPE, # E40 Legal Body
'viaf:geographic': GEOGRAPHIC_CONCEPT_TYPE, # E53 Place
}

SUBMIT_WAIT_TIME = {
'days': 3,
'hours': 0,
'minutes': 0
}

0 comments on commit ac25a58

Please sign in to comment.