Project

General

Profile

Bug #1277

Related work reference checking imperfect

Added by Luke Murphey about 8 years ago. Updated about 8 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Start date:
03/28/2016
Due date:
% Done:

100%


Description

To reproduce:

  1. Open ASV at Genesis 1
  2. Note that New Testament is displayed in related works list
  3. Opening the New Testament generates an error

History

#1 Updated by Luke Murphey about 8 years ago

This fails when no division is provided in the URL.

#2 Updated by Luke Murphey about 8 years ago


def determine_if_work_has_division(work, division):

    # Determine if this particular division is included

    # Build a list of the divisions in the heirarchy
    divisions_heirarchy = []

    next_division = division

    while next_division is not None:

            divisions_heirarchy.insert(0, next_division)

            # Get the next division
            next_division = next_division.parent_division

    # Match up the division in the related work
    parent_division = None

    for d in divisions_heirarchy:

        matched_divisions = Division.objects.filter(title=d.title, parent_division=parent_division)[:1]

        if matched_divisions.length > 0:
            parent_division = matched_divisions[0]
        else:
            # Should try after normalizing the name
            return False

    return True

#3 Updated by Luke Murphey about 8 years ago

  • Status changed from New to In Progress
  • % Done changed from 0 to 80

#4 Updated by Luke Murphey about 8 years ago

  • Status changed from In Progress to Closed
  • % Done changed from 80 to 100

Also available in: Atom PDF