Skip to content

Commit

Permalink
remove unneeded lines
Browse files Browse the repository at this point in the history
  • Loading branch information
claire-peters committed Nov 17, 2023
1 parent 0b467c3 commit bfcbdb3
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions coldfront/core/allocation/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -728,25 +728,19 @@ class Meta:
verbose_name_plural = 'Allocation User Status'
unique_together = ('user', 'allocation')

def get_attribute(self, name, expand=True, typed=True,
extra_allocations=[]):
def get_attribute(self, name, typed=True):
"""
Params:
name (str): name of the allocation attribute type
expand (bool): indicates whether or not to return the expanded value with attributes/parameters for attributes with a base type of 'Attribute Expanded Text'
typed (bool): indicates whether or not to convert the attribute value to an int/ float/ str based on the base AttributeType name
extra_allocations (list[Allocation]): allocations which are available to reference in the attribute list in addition to those associated with this AllocationAttribute
Returns:
str: the value of the first attribute found for this allocation with the specified name
"""

attr = self.allocationuserattribute_set.filter(
allocation_attribute_type__name=name).first()
allocationuser_attribute_type__name=name).first()
if attr:
if expand:
return attr.expanded_value(
extra_allocations=extra_allocations, typed=typed)
if typed:
return attr.typed_value()
return attr.value
Expand Down

0 comments on commit bfcbdb3

Please sign in to comment.