Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 931488c288 | |||
| ab897fd848 | |||
| 4f189b4d66 | |||
| 1487504318 |
12
PROJECT.org
12
PROJECT.org
@ -604,6 +604,18 @@ independent of the email flow it was originally creatdd for
|
|||||||
|
|
||||||
** TODO [#B] Is there way to create unique slugs for media instances :media_types:
|
** TODO [#B] Is there way to create unique slugs for media instances :media_types:
|
||||||
|
|
||||||
|
* Version 56.3 [1/1]
|
||||||
|
** DONE [#A] Fix bug in importer script from discgolf being added :bug:
|
||||||
|
:PROPERTIES:
|
||||||
|
:ID: c3733f96-18f1-eef8-f5d9-edaf97e35623
|
||||||
|
:END:
|
||||||
|
|
||||||
|
* Version 56.2 [1/1]
|
||||||
|
** DONE [#A] Fix bug in creating people when importing course plays :discgolf:bug:
|
||||||
|
:PROPERTIES:
|
||||||
|
:ID: 255e9886-098b-39ae-1077-25e43223660e
|
||||||
|
:END:
|
||||||
|
|
||||||
* Version 56.1 [1/1]
|
* Version 56.1 [1/1]
|
||||||
** DONE [#A] Add tests to discgolf app :discgolf:tests:
|
** DONE [#A] Add tests to discgolf app :discgolf:tests:
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
[tool.poetry]
|
[tool.poetry]
|
||||||
name = "vrobbler"
|
name = "vrobbler"
|
||||||
version = "56.1"
|
version = "56.3"
|
||||||
description = ""
|
description = ""
|
||||||
authors = ["Colin Powell <colin@unbl.ink>"]
|
authors = ["Colin Powell <colin@unbl.ink>"]
|
||||||
|
|
||||||
|
|||||||
@ -15,9 +15,12 @@ def _parse_udisc_datetime(raw: str) -> datetime:
|
|||||||
return parse_datetime(raw)
|
return parse_datetime(raw)
|
||||||
|
|
||||||
|
|
||||||
def _resolve_player(name: str) -> Person:
|
def _resolve_player(name: str, user_id: int) -> Person:
|
||||||
person, _ = Person.objects.get_or_create(name=name.strip())
|
name = name.strip()
|
||||||
return person
|
existing = Person.objects.filter(name=name, created_by_id=user_id).first()
|
||||||
|
if existing:
|
||||||
|
return existing
|
||||||
|
return Person.objects.create(name=name, created_by_id=user_id)
|
||||||
|
|
||||||
|
|
||||||
def import_udisc_csv(
|
def import_udisc_csv(
|
||||||
@ -95,10 +98,10 @@ def import_udisc_csv(
|
|||||||
|
|
||||||
if is_teams:
|
if is_teams:
|
||||||
people = player_name.split("+")
|
people = player_name.split("+")
|
||||||
person_ids = [_resolve_player(p.strip()).id for p in people]
|
person_ids = [_resolve_player(p.strip(), user_id).id for p in people]
|
||||||
hole_scores["person_ids"] = person_ids
|
hole_scores["person_ids"] = person_ids
|
||||||
else:
|
else:
|
||||||
person = _resolve_player(player_name)
|
person = _resolve_player(player_name, user_id)
|
||||||
hole_scores["person_id"] = person.id
|
hole_scores["person_id"] = person.id
|
||||||
|
|
||||||
scores[player_name] = hole_scores
|
scores[player_name] = hole_scores
|
||||||
|
|||||||
@ -93,6 +93,7 @@ def import_from_webdav_for_all_users(
|
|||||||
bgstats_count,
|
bgstats_count,
|
||||||
ebird_count,
|
ebird_count,
|
||||||
scale_count,
|
scale_count,
|
||||||
|
udisc_count,
|
||||||
extra={
|
extra={
|
||||||
"koreader": ko_count,
|
"koreader": ko_count,
|
||||||
"trail_gpx": gpx_count,
|
"trail_gpx": gpx_count,
|
||||||
|
|||||||
Reference in New Issue
Block a user