Skip to content
Open
Show file tree
Hide file tree
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: 4 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -315,9 +315,10 @@ django-import-export = { git = "https://github.com/mpasternak/django-import-expo
# commita gałęzi feat/error-record, żeby CI/lokalnie rozwiązać zależność.
# USUŃ po wydaniu pbn-client 0.2.1 na PyPI (wtedy sam pin >=0.2.1,<0.3 wystarczy).
pbn-client = { git = "https://github.com/iplweb/pbn-client.git", rev = "84503cf41b308bc86edc6f8709b71383a8676cac" }
# TYMCZASOWO: django-pbn-client 0.2.1 (sync_dictionary, D3) nie jest jeszcze na
# PyPI. Pin do commita gałęzi feat/sync-dictionary. USUŃ po wydaniu 0.2.1.
django-pbn-client = { git = "https://github.com/iplweb/django-pbn-client.git", rev = "9b2164f889861db9292b91508debf0732211bb39" }
# TYMCZASOWO: django-pbn-client 0.2.2 (sync_dictionary D3 + with_deleted_marker
# A2) nie jest jeszcze na PyPI. Pin do commita gałęzi feat/deleted-marker
# (stacked na feat/sync-dictionary). USUŃ po wydaniu 0.2.2 na PyPI.
django-pbn-client = { git = "https://github.com/iplweb/django-pbn-client.git", rev = "bb952e98967a96f96cd3773e3dcfcaf4555c8690" }

# Konfiguracja `pytest-testcontainers-django` — pluginu pytest, ktory
# startuje kontenery PG/Redis przed importem Django settings i wstrzykuje
Expand Down
4 changes: 4 additions & 0 deletions src/bpp/newsfragments/pbn-a2-deleted-marker.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Marker „[❌ USUNIĘTY]" w reprezentacji tekstowej lustrzanych obiektów PBN
(instytucje, publikacje, konferencje, wydawcy, czasopisma, naukowcy) korzysta
teraz ze wspólnego helpera ``with_deleted_marker`` z pakietu
``django-pbn-client`` — koniec sześciu zduplikowanych bloków ``if is_deleted``.
4 changes: 1 addition & 3 deletions src/pbn_api/models/conference.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,4 @@ def country(self):

def __str__(self):
ret = f"{self.fullName()}, {self.startDate()}, {self.city()}"
if self.is_deleted:
ret = f"[❌ USUNIĘTY] {ret}"
return ret
return self.with_deleted_marker(ret)
4 changes: 1 addition & 3 deletions src/pbn_api/models/institution.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,7 @@ def __str__(self):
while ret.find(",,") != -1:
ret = ret.replace(",,", ",")
ret = ret.replace(", (", " (")
if self.is_deleted:
ret = f"[❌ USUNIĘTY] {ret}"
return ret
return self.with_deleted_marker(ret)

@cached_property
def rekord_w_bpp(self):
Expand Down
4 changes: 1 addition & 3 deletions src/pbn_api/models/journal.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ def __str__(self):
f"{self.title}, ISSN: {self.issn or '-'}, "
f"EISSN: {self.eissn or '-'}, MNISW ID: {self.mniswId or '-'}"
)
if self.is_deleted:
ret = f"[❌ USUNIĘTY] {ret}"
return ret
return self.with_deleted_marker(ret)

def rekord_w_bpp(self):
from bpp.models import Zrodlo
Expand Down
4 changes: 1 addition & 3 deletions src/pbn_api/models/publication.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,4 @@ def __str__(self):
ret += f", {self.year}"
if self.doi:
ret += f", {self.doi}"
if self.is_deleted:
ret = f"[❌ USUNIĘTY] {ret}"
return ret
return self.with_deleted_marker(ret)
4 changes: 1 addition & 3 deletions src/pbn_api/models/publisher.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ class Meta:

def __str__(self):
ret = f"{self.publisherName}, MNISW ID: {self.mniswId or '-'}"
if self.is_deleted:
ret = f"[❌ USUNIĘTY] {ret}"
return ret
return self.with_deleted_marker(ret)

@property
def points(self):
Expand Down
4 changes: 1 addition & 3 deletions src/pbn_api/models/scientist.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,7 @@ def __str__(self):
ret = ret.replace(" ,", ",")
ret = ret.replace("-, ", "")
ret = ret.replace(", (", " (")
if self.is_deleted:
ret = f"[❌ USUNIĘTY] {ret}"
return ret
return self.with_deleted_marker(ret)

@cached_property
def rekord_w_bpp(self):
Expand Down
6 changes: 3 additions & 3 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading