Code Monkey home page Code Monkey logo

donation-tracker's Issues

Router with basename is already registered

It seems like some routes (specifically these in /tracker/api/urls.py)

router.register(
    r'events/(?P<event_pk>[^/.]+)/' + path + r'/feed_(?P<feed>\w+)',
    viewset,
    **kwargs,
)

and

router.register(r'events/(?P<event_pk>[^/.]+)/' + path, viewset, **kwargs)

have some problems as I'm constantly running into a django.core.exceptions.ImproperlyConfigured exception with comment: Router with basename "bid" is already registered. Please provide a unique basename for viewset "<class 'tracker.api.views.bids.BidViewSet'>"

Now this seems to go away if you just comment the lines and most parts of the tracker seem to work, but unfortunately, this is a consistently reproducible issue that I couldn't find a way around.

Broken class on donation page

When looking at the html I found one of the classes were broken on the donation page
image

It seems that its an issue with the variable commentstate on the templates/tracker/donation.html page

Commentators missing from runs

I'm working on a little Go library and Matrix bot which right now relies on parsing /schedule. I only recently discovered /tracker and it actually having an API which is fantastic compared to scraping the HTML.

In trying to transition my client and bot to using /tracker/api/v1/search?run&event=ID to get the schedule for an event, I've discovered one snafu. The API does not return the hosts/commentators for a run. The commentators field is always "". I do get this from /schedule so I imagine there is a way to get the info, but I can't figure it out.

In the same vein, I noticed deprecated_runners and the runners array instead, but the latter only returns the runner ID, which would result in me having to do a bajillion more queries. Is there any way, through a query param or otherwise, to get that information inlined instead? It's been close to a decade since I last worked on a Django codebase so I'm a little lost trying to figure this out.

I realise we're close to an event so just wanted to say Thank You for everything and Good Luck!

Missing "can edit locked events" pemission causes tracker crash

This issue occurred regardless of the event in question being locked or unlocked. If a user with permission to change donations but not permission to edit locked events tried to hit save on a donation (whether or not a change was being made), the following error appeared:
tracker_error

Stack trace pointed to the following as the issue, where the event object had no locked attribute:

if not request.user.has_perm('tracker.can_edit_locked_events'):
event = form.cleaned_data.get('event', None)
# this is a truly degenerate case
# a user either has to be:
# - adding a new child to event N
# - changing an existing child to point to event N when it wasn't before
# in addition to the following two conditions:
# - event N was not locked when the user opened the form, but got locked before the user could save
# - was not caught by existing machinery (choice validation, etc)
if event.locked:
raise PermissionDenied

Running python 3.9.16 with django 3.2, if it makes a difference

[FYI] This code is being included in a large code dataset without notice

Hi, I've noticed that GDQ code(more repos than this one, but I figured this was the best place to open this) is being included in a massive(67TB) AI training dataset called The Stack. Unfortunately, they have an opt-out consent mechanism(which isn't true consent but I digress), so if you want your organization's code to be removed, you can go to https://huggingface.co/spaces/bigcode/in-the-stack to see which repos are impacted and how to opt out.

If this isn't a concern for you folks, feel free to close this, I'm just not interested in seeing everything vacuummed up without consent by AI bros, especially free software that's made to help facilitate causes like GDQ's charity donations. Thanks for your amazing work throughout the years, and gave a great day!

P.S: I'm not a bot, if this somehow sounds like a bot wrote it. I'm human, I promise.

Incentive amount allocated before changing donation amount invalidates settings

At /tracker/ui/donate, if a donation amount is set and then an incentive is selected, the incentive allocation could end up being greater than the donation amount if the donation amount gets changes. This results in the following error on the page:

Unable to update the settings, those are invalid: [Error: The value [25] being set falls outside of the minimumValue [0.00] and maximumValue [2.00] range set for this element]

Steps to reproduce:

  1. Navigate to /tracker/ui/donate (e.g. https://gamesdonequick.com/tracker/ui/donate/28)
  2. Enter a donation amount (e.g. $25.00)
  3. Under Incentives, select Add Incentives
  4. Select an incentive (e.g. a bonus game incentive, which will pre-allocate the donation amount to the incentive)
  5. Return to the donation amount and alter the amount so that the donation amount is less than the incentive amount. (e.g. backspace the 5 in 25 to change the value to 26. The value will temporarily be 2.)
  6. Notice that the donation form is replaced with an error message and a stacktrace (included below.

Stacktrace:
Error: Unable to update the settings, those are invalid: [Error: The value [50] being set falls outside of the minimumValue [0.00] and maximumValue [25.00] range set for this element] at Function.value (https://gamesdonequick.com/static/tracker/gen/tracker-tracker-cc34d87aaade3b948e1b.js:39:102542) at e.value (https://gamesdonequick.com/static/tracker/gen/tracker-tracker-cc34d87aaade3b948e1b.js:39:195909) at t.value (https://gamesdonequick.com/static/tracker/gen/tracker-tracker-cc34d87aaade3b948e1b.js:39:75611) at Ao (https://gamesdonequick.com/static/tracker/gen/tracker-tracker-cc34d87aaade3b948e1b.js:23:51474) at Xa (https://gamesdonequick.com/static/tracker/gen/tracker-tracker-cc34d87aaade3b948e1b.js:23:69469) at Cs (https://gamesdonequick.com/static/tracker/gen/tracker-tracker-cc34d87aaade3b948e1b.js:23:105897) at Al (https://gamesdonequick.com/static/tracker/gen/tracker-tracker-cc34d87aaade3b948e1b.js:23:90221) at Nl (https://gamesdonequick.com/static/tracker/gen/tracker-tracker-cc34d87aaade3b948e1b.js:23:90146) at Sl (https://gamesdonequick.com/static/tracker/gen/tracker-tracker-cc34d87aaade3b948e1b.js:23:87486) at https://gamesdonequick.com/static/tracker/gen/tracker-tracker-cc34d87aaade3b948e1b.js:23:45816

[Feature Request] Jump to current time in /schedule

It would be very convenient for mobile users to be able to jump to the current time in the schedule instead of having to manually scroll. Highlighting the current run in the schedule would also make it much easier to determine at a glance.

I'm not sure if this repo is currently accepting PR's, but I would be glad to contribute!

v2 API mostly returns HTTP 500s

Looking at the endpoints for v2, I get the following patterns:

tracker/ api/v2/ ^events/$ [name='event-list']
tracker/ api/v2/ ^events\.(?P<format>[a-z0-9]+)/?$ [name='event-list']
tracker/ api/v2/ ^events/(?P<pk>[^/.]+)/$ [name='event-detail']
tracker/ api/v2/ ^events/(?P<pk>[^/.]+)\.(?P<format>[a-z0-9]+)/?$ [name='event-detail']
tracker/ api/v2/ ^runners/$ [name='runner-list']
tracker/ api/v2/ ^runners\.(?P<format>[a-z0-9]+)/?$ [name='runner-list']
tracker/ api/v2/ ^runners/(?P<pk>[^/.]+)/$ [name='runner-detail']
tracker/ api/v2/ ^runners/(?P<pk>[^/.]+)\.(?P<format>[a-z0-9]+)/?$ [name='runner-detail']
tracker/ api/v2/ ^runs/$ [name='speedrun-list']
tracker/ api/v2/ ^runs\.(?P<format>[a-z0-9]+)/?$ [name='speedrun-list']
tracker/ api/v2/ ^runs/(?P<pk>[^/.]+)/$ [name='speedrun-detail']
tracker/ api/v2/ ^runs/(?P<pk>[^/.]+)\.(?P<format>[a-z0-9]+)/?$ [name='speedrun-detail']
tracker/ api/v2/ ^$ [name='api-root']
tracker/ api/v2/ ^\.(?P<format>[a-z0-9]+)/?$ [name='api-root']
tracker/ api/v2/ api-auth/ login/ [name='login']
tracker/ api/v2/ api-auth/ logout/ [name='logout'] 

However, trying to request /events/ seems to always return an HTTP 500:

$ curl https://gamesdonequick.com/tracker/api/v2/events/ -H "Accept: application/json" -vv

< HTTP/2 500 
< date: Sat, 15 May 2021 12:03:19 GMT
< content-type: text/html; charset=utf-8
< vary: Accept-Language, Cookie
< content-language: en

Server done blowed up

Varying the "Accept" header doesn't seem to matter either.

I get the same for just about any /events endpoint, /runs/ times out and some of the /run/ endpoints seem to also just 500 across the board.

I tried it with a local copy of donation-tracker, and in that case doing a request like curl http://localhost:8000/tracker/api/v2/events/ -vv doesn't blow up:

*   Trying ::1:8000...
* connect to ::1 port 8000 failed: Connection refused
*   Trying 127.0.0.1:8000...
* Connected to localhost (127.0.0.1) port 8000 (#0)
> GET /tracker/api/v2/events/ HTTP/1.1
> Host: localhost:8000
> User-Agent: curl/7.76.1
> Accept: */*
> 
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Content-Type: application/json
< Vary: Accept, Cookie
< Allow: GET, HEAD, OPTIONS
< X-Frame-Options: SAMEORIGIN
< Content-Length: 2
< 
* Connection #0 to host localhost left intact
[]

Once I add an event to the database, things start to blow up locally too:

  • /events/ returns:
    Exception Type: TemplateDoesNotExist
    Exception Value: rest_framework/api.html
  • /events.json or /events.json/ returns:
    Exception Type: TypeError at /tracker/api/v2/events.json
    Exception Value: list() got an unexpected keyword argument 'format'

Based on what I'm seeing, is the v2 API in a state where it's expected to work and be used?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.