Skip to content

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
  • Loading branch information
= committed Sep 6, 2024
1 parent 6c35671 commit bfb2542
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 28 deletions.
3 changes: 2 additions & 1 deletion auctions/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,8 @@ class UserAdmin(BaseUserAdmin):
def last_activity(self, obj):
return obj.userdata.last_activity

last_activity.admin_order_field = "userdata__last_activity" # this doesn't seem to work, but you can use this url: admin/auth/user/?o=-4
# this doesn't seem to work, but you can use this url: admin/auth/user/?o=-4
last_activity.admin_order_field = "userdata__last_activity"
last_activity.short_description = "Last activity"


Expand Down
3 changes: 2 additions & 1 deletion auctions/context_processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ def theme(request):
)
# theme = userData.use_dark_theme
show_ads = userData.show_ads
show_ads = False # ads off for everyone! (at least for now...we made $46 in a year from google ads, what a joke!)
# ads off for everyone! (at least for now...we made $46 in a year from google ads, what a joke!)
show_ads = False
return {"theme": theme, "show_ads": show_ads}


Expand Down
19 changes: 12 additions & 7 deletions auctions/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class AuctionTOSFilter(django_filters.FilterSet):
"hx-target": "div.table-container",
"hx-trigger": "keyup changed delay:300ms",
"hx-swap": "outerHTML",
#'hx-indicator':".progress",
# 'hx-indicator':".progress",
}
),
)
Expand Down Expand Up @@ -234,7 +234,7 @@ class LotAdminFilter(django_filters.FilterSet):
"hx-target": "div.table-container",
"hx-trigger": "keyup changed delay:300ms",
"hx-swap": "outerHTML",
#'hx-indicator':".progress",
# 'hx-indicator':".progress",
}
),
)
Expand Down Expand Up @@ -309,7 +309,8 @@ def __init__(self, *args, **kwargs):
self.longitude = self.user.userdata.longitude
except:
pass
self.showLocal = True # annotate lots with the distance to the request user, requires self.latitude and self.longitude
# annotate lots with the distance to the request user, requires self.latitude and self.longitude
self.showLocal = True
try:
if not self.latitude and not self.longitude:
self.showLocal = False
Expand All @@ -325,14 +326,17 @@ def __init__(self, *args, **kwargs):
if self.user.is_superuser:
self.showBanned = True
else:
self.showBanned = False # this is really only set to true if you are viewing your own lots
self.showViewed = "all" # could be "yes" or "no", only matters for authenticated users, set to no to only see unseen things
# this is really only set to true if you are viewing your own lots
self.showBanned = False
# could be "yes" or "no", only matters for authenticated users, set to no to only see unseen things
self.showViewed = "all"
try:
if kwargs.pop("onlyUnviewed"):
self.showViewed = "no"
except:
pass
self.status = "open" # "all", "open", "unsold", or "ended". If regarding an auction, should default to all
# "all", "open", "unsold", or "ended". If regarding an auction, should default to all
self.status = "open"
self.showShipping = True
self.shippingLocation = (
52 # USA, later we might set this with a cookie like we do with lat and lng
Expand All @@ -357,7 +361,8 @@ def __init__(self, *args, **kwargs):
try:
self.regardingUser = kwargs.pop("regardingUser")
except:
self.regardingUser = None # force only displaying lots for a particular user (not necessarily the request user)
# force only displaying lots for a particular user (not necessarily the request user)
self.regardingUser = None
try:
self.order = kwargs.pop(
"order"
Expand Down
18 changes: 9 additions & 9 deletions auctions/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,8 +395,8 @@ def __init__(self, auction, *args, **kwargs):
self.helper.layout = Layout(
"invoice",
"auction",
#'lot',
#'winner',
# 'lot',
# 'winner',
# <div class="col-md-3">
# <div id="div_id_winning_price" class="form-group">
# <div class="">
Expand Down Expand Up @@ -729,7 +729,7 @@ class Meta:
"auction",
"species_category",
"description",
#'auctiontos_seller',
# 'auctiontos_seller',
"quantity",
"donation",
"i_bred_this_fish",
Expand All @@ -741,7 +741,7 @@ class Meta:
]
widgets = {
"description": forms.Textarea(attrs={"rows": 2}),
#'auctiontos_seller': autocomplete.ModelSelect2(url='auctiontos-autocomplete', forward=['auction'], attrs={'data-html': True, 'data-container-css-class': ''}),
# 'auctiontos_seller': autocomplete.ModelSelect2(url='auctiontos-autocomplete', forward=['auction'], attrs={'data-html': True, 'data-container-css-class': ''}),
"auctiontos_winner": autocomplete.ModelSelect2(
url="auctiontos-autocomplete",
forward=["auction"],
Expand Down Expand Up @@ -1411,8 +1411,8 @@ def __init__(self, user, auction, *args, **kwargs):
"The pin on the map must be at the <span class='text-warning'>exact location of the pickup location!</span><br><small>People will get directions based on this pin, and will get lost if it's not in the right place</small>"
),
),
#'allow_selling_by_default',
#'allow_bidding_by_default',
# 'allow_selling_by_default',
# 'allow_bidding_by_default',
css_id="non-mail",
),
"description",
Expand Down Expand Up @@ -1497,7 +1497,7 @@ class Meta:
]
widgets = {
"date_start": DateTimePickerInput(),
#'is_online': HiddenInput(),
# 'is_online': HiddenInput(),
}

def __init__(self, *args, **kwargs):
Expand Down Expand Up @@ -1974,8 +1974,8 @@ class Meta:
exclude = ["user", "image", "image_source"]
widgets = {
"description": forms.Textarea(),
#'species': forms.HiddenInput(),
#'cloned_from': forms.HiddenInput(),
# 'species': forms.HiddenInput(),
# 'cloned_from': forms.HiddenInput(),
"shipping_locations": forms.CheckboxSelectMultiple(),
}

Expand Down
10 changes: 5 additions & 5 deletions fishauctions/asgi.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
import os

from channels.auth import AuthMiddlewareStack
from channels.routing import ProtocolTypeRouter, URLRouter
from channels.security.websocket import AllowedHostsOriginValidator
from django.core.asgi import get_asgi_application
from django.urls import re_path

from auctions.consumers import LotConsumer

# Fetch Django ASGI application early to ensure AppRegistry is populated
# before importing consumers and AuthMiddlewareStack that may import ORM
# models.
# ruff: noqa: E402
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "fishauctions.settings")
django_asgi_app = get_asgi_application()

from channels.auth import AuthMiddlewareStack
from channels.routing import ProtocolTypeRouter, URLRouter
from channels.security.websocket import AllowedHostsOriginValidator

from auctions.consumers import LotConsumer

application = ProtocolTypeRouter(
{
Expand Down
5 changes: 0 additions & 5 deletions fishauctions/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@
https://docs.djangoproject.com/en/3.1/ref/settings/
"""

# try:
# from . import customsettings
# except:
# pass
# #print("You can set your envionrment using a customsettings.py file. No file found, or file is invalid, assuming the environment has been set some other way.")
import datetime
import os
import sys
Expand Down

0 comments on commit bfb2542

Please sign in to comment.