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

Cria Processamento Para Logos dos Periódicos e Adiciona o campo url_logo na API de Journal #838

Merged
merged 16 commits into from
Sep 3, 2024
Merged
Changes from 1 commit
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
3 changes: 3 additions & 0 deletions institution/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,9 @@ def get_or_create(cls, institution, initial_date=None, final_date=None, user=Non
class Meta:
abstract = True

def __str__(self):
if self.institution.institution:
return self.institution.institution.institution_identification.name
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@samuelveigarangel tem que retornar str sempre. Também teria que testar a existência de self.institution.institution.institution_identification

try:
    return self.institution.institution.institution_identification.name
except AttributeError:
    return ''


class BaseInstitution(CommonControlField):
institution = models.ForeignKey(
Expand Down