Skip to content

Commit

Permalink
bug fix for research resource.
Browse files Browse the repository at this point in the history
  • Loading branch information
rpaw053 committed Oct 21, 2019
1 parent 85cd2b7 commit 055950b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion orcid_hub/models.py
Expand Up @@ -3498,7 +3498,7 @@ class Meta: # noqa: D101,D106
class Invitee(BaseModel):
"""Common model bits of the invitees records."""

identifier = CharField(max_length=120, null=True, verbose_name="Local ID")
identifier = CharField(max_length=120, null=True, verbose_name="Local Identifier")
email = CharField(max_length=120, null=True)
orcid = OrcidIdField(null=True)
first_name = CharField(max_length=120, null=True)
Expand Down
5 changes: 5 additions & 0 deletions orcid_hub/utils.py
Expand Up @@ -2546,6 +2546,11 @@ def enqueue_user_records(user):
records = records.join(WorkInvitee).where(
(WorkInvitee.email.is_null() | (WorkInvitee.email == user.email)),
(WorkInvitee.orcid.is_null() | (WorkInvitee.orcid == user.orcid)))
# TODO: Handle Research Resource json enqueing
# elif task.task_type == TaskType.RESOURCE and hasattr(task.record_model, "invitees"):
# inv = task.record_model.invitees.rel_model
# records = records.where((inv.email.is_null() | (inv.email == user.email)),
# (inv.orcid.is_null() | (inv.orcid == user.orcid)))
else:
records = records.where(
(task.record_model.email.is_null() | (task.record_model.email == user.email)),
Expand Down
5 changes: 2 additions & 3 deletions orcid_hub/views.py
Expand Up @@ -803,7 +803,7 @@ def action_activate(self, ids):
try:
status = "The record was activated at " + datetime.now().isoformat(timespec="seconds")
count = self.model.update(is_active=True, status=status).where(
self.model.is_active == False, # noqa: E712
((self.model.is_active.is_null()) | (self.model.is_active == False)), # noqa: E712
self.model.id.in_(ids)).execute()
if self.model == AffiliationRecord:
records = self.model.select().where(self.model.id.in_(ids)).order_by(
Expand Down Expand Up @@ -2045,10 +2045,9 @@ def action_insert_update(self, ids):
class ResourceRecordAdmin(RecordModelView):
"""Researcher resource administration view."""

# column_labels = dict(identifier="Local ID")

form_rules = [
# rules.Header("Record"),
"local_id",
"is_active",
"display_index",
"visibility",
Expand Down

0 comments on commit 055950b

Please sign in to comment.