icosa-foundation / icosa-gallery

Icosa Gallery is a 3D model hosting solution, intended as a replacement for Google's Poly
https://icosa.gallery
Apache License 2.0
8 stars 0 forks source link

Error saving via API #56

Open andybak opened 1 week ago

andybak commented 1 week ago
Unexpected response from Icosa: Traceback (most recent call last):
  File "/venv/lib/python3.11/site-packages/ninja/operation.py", line 107, in run
    result = self.view_func(request, **values)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/icosa/api/assets.py", line 308, in upload_new_assets
    asset = Asset.objects.create(
            ^^^^^^^^^^^^^^^^^^^^^
  File "/venv/lib/python3.11/site-packages/django/db/models/manager.py", line 87, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/venv/lib/python3.11/site-packages/django/db/models/query.py", line 679, in create
    obj.save(force_insert=True, using=self.db)
  File "/opt/icosa/models.py", line 470, in save
    self.rank = self.get_updated_rank()
                ^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/icosa/models.py", line 445, in get_updated_rank
    return asset_qs.first().rank
           ^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'rank'
jamesrampton commented 1 week ago

Fixed for API and front end