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

Can't create tags anonymously #682

Open
CrawlerBleak opened this issue Oct 13, 2024 · 0 comments
Open

Can't create tags anonymously #682

CrawlerBleak opened this issue Oct 13, 2024 · 0 comments

Comments

@CrawlerBleak
Copy link

It seems the codebase assumes that tag creators are logged in:

[2024-10-13 14:51:47 -0700] [546457] [ERROR] Error handling request /post/232
Traceback (most recent call last):
  File "/home/booru/.venv/lib/python3.11/site-packages/gunicorn/workers/gthread.py", line 281, in handle
    keepalive = self.handle_request(req, conn)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/booru/.venv/lib/python3.11/site-packages/gunicorn/workers/gthread.py", line 333, in handle_request
    respiter = self.wsgi(environ, resp.start_response)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/booru/server/szurubooru/rest/app.py", line 104, in application
    response = handler(ctx, match.groupdict())
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/booru/server/szurubooru/api/post_api.py", line 145, in update_post
    snapshots.create(tag, ctx.user)
  File "/opt/booru/server/szurubooru/func/snapshots.py", line 126, in create
    _post_to_webhooks(snapshot)
  File "/opt/booru/server/szurubooru/func/snapshots.py", line 100, in _post_to_webhooks
    net.post_to_webhooks(serialize_snapshot(snapshot, webhook_user))
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/booru/server/szurubooru/func/snapshots.py", line 90, in serialize_snapshot
    "user": users.serialize_micro_user(snapshot.user, auth_user),
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/booru/server/szurubooru/func/users.py", line 174, in serialize_micro_user
    return serialize_user(
           ^^^^^^^^^^^^^^^
  File "/opt/booru/server/szurubooru/func/users.py", line 168, in serialize_user
    return UserSerializer(user, auth_user, force_show_email).serialize(options)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/booru/server/szurubooru/func/serialization.py", line 25, in serialize
    ret[key] = factory()
               ^^^^^^^^^
  File "/opt/booru/server/szurubooru/func/users.py", line 139, in serialize_avatar_url
    return get_avatar_url(self.user)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/booru/server/szurubooru/func/users.py", line 51, in get_avatar_url
    assert user.name
AssertionError

I would like my booru to be editable anonymously. To that end, I need people to be able to submit new tags for posts. How can I achieve that?

P.S. I correctly have tags:create and posts:edit:tags set to anonymous.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant