Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for type abbrev. Closes #304 #307

Merged
merged 1 commit into from
Apr 14, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion server_py/flatgov/bills/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
from iteration_utilities import flatten
from django.utils.translation import gettext_lazy as _

from bills.templatetags.bill_filters import stagesFormat

MAX_RELATED_BILLS = 30

class Bill(models.Model):
Expand Down Expand Up @@ -35,7 +37,10 @@ def __str__(self):
return self.bill_congress_type_number

def get_type_abbrev(self) -> str:
return ''.join([letter.upper() + '.' for letter in self.type])
if self.type:
return stagesFormat.get(self.type.upper(), '')
else:
return ''

def get_related_bill_numbers(self):
return self.related_dict.keys()
Expand Down