Skip to content

Commit

Permalink
ElectionDay: Fixes license portion of catalog.rdf for Open Data Swiss
Browse files Browse the repository at this point in the history
This also fixes the same bug for Landsgemeinde

TYPE: Bugfix
LINK: OGC-1729
  • Loading branch information
Daverball authored Oct 15, 2024
1 parent 6f9d132 commit 0d5f068
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/onegov/core/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def instance_lru_cache(
def decorator(wrapped: '_F') -> '_F':
def wrapper(self: Any) -> Any:
return lru_cache(maxsize=maxsize)(
update_wrapper(partial(wrapped, self), wrapped) # type:ignore
update_wrapper(partial(wrapped, self), wrapped)
)

# NOTE: we are doing some oddball stuff here that the type
Expand Down
4 changes: 2 additions & 2 deletions src/onegov/core/cli/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ def __init__(self, queue_processors: list[SmsQueueProcessor]):
)

def on_moved(self, event: 'FileSystemEvent') -> None:
dest_path = os.path.abspath(event.dest_path)
dest_path = os.path.abspath(event.dest_path) # type:ignore[type-var]
assert isinstance(dest_path, str)
for qp in self.queue_processors:
# only one queue processor should match
Expand All @@ -208,7 +208,7 @@ def on_moved(self, event: 'FileSystemEvent') -> None:
# moved. But we should also trigger when new files are created just
# in case this ever changes.
def on_created(self, event: 'FileSystemEvent') -> None:
src_path = os.path.abspath(event.src_path)
src_path = os.path.abspath(event.src_path) # type:ignore[type-var]
assert isinstance(src_path, str)
for qp in self.queue_processors:
# only one queue processor should match
Expand Down
8 changes: 2 additions & 6 deletions src/onegov/election_day/views/opendata_swiss.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,12 +322,8 @@ def translate(text: 'TranslationString', locale: str) -> str:
sub(dist, 'dcat:downloadURL', {'rdf:resource': url})

# Legal
license = sub(
dist, 'dct:license',
{'rdf:about': 'http://dcat-ap.ch/vocabulary/licenses/terms_by'}
)
sub(license, 'rdf:type', {
'rdf:resource': 'http://purl.org/dc/terms/RightsStatement'
sub(dist, 'dct:license', {
'rdf:resource': 'http://dcat-ap.ch/vocabulary/licenses/terms_by'
})

# Media Type
Expand Down
8 changes: 2 additions & 6 deletions src/onegov/landsgemeinde/views/opendata_swiss.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,12 +187,8 @@ def set_headers(response: 'Response') -> None:
url = request.link(item, 'json')
sub(dist, 'dcat:accessURL', {'rdf:resource': url})
sub(dist, 'dcat:downloadURL', {'rdf:resource': url})
license = sub(
dist, 'dct:license',
{'rdf:about': 'http://dcat-ap.ch/vocabulary/licenses/terms_by'}
)
sub(license, 'rdf:type', {
'rdf:resource': 'http://purl.org/dc/terms/RightsStatement'
sub( dist, 'dct:license', {
'rdf:resource': 'http://dcat-ap.ch/vocabulary/licenses/terms_by'
})
sub(dist, 'dcat:mediaType', {
'rdf:resource': 'https://www.iana.org/assignments/media-types/'
Expand Down
2 changes: 1 addition & 1 deletion src/onegov/org/models/ticket.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ def get_links( # type:ignore[override]
url_obj = URL(request.link(self.submission))
edit_url = url_obj.query_param('edit', '').as_string()

(links if not links else extra).append( # type:ignore
(links if not links else extra).append(
Link(
text=_('Edit submission'),
url=request.return_here(edit_url),
Expand Down

0 comments on commit 0d5f068

Please sign in to comment.