-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #115 from fleizean/mpa
New Module, Ranking, AI skills.
- Loading branch information
Showing
36 changed files
with
557 additions
and
361 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ | |
BALL_RADIUS = 10 | ||
BALL_SPEED = 1 | ||
|
||
MAX_SCORE = 20 | ||
MAX_SCORE = 10 | ||
|
||
class Status(Enum): | ||
ACCEPTED = 0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,34 @@ | ||
from django.core.management.base import BaseCommand | ||
from pong.models import UserProfile, StoreItem | ||
from pong.models import UserProfile, StoreItem, Social | ||
from django.core.files import File | ||
from os import environ | ||
import json | ||
|
||
class Command(BaseCommand): | ||
def handle(self, *args, **options): | ||
# Create superuser if not exists | ||
if not UserProfile.objects.filter(username="Bitlis").exists(): | ||
UserProfile.objects.create_superuser("Bitlis", "[email protected]", environ.get("SUPER_PASS", default="9247")) | ||
self.stdout.write(self.style.SUCCESS('Superuser created successfully.')) | ||
# Create IndianAI if not exists | ||
if not UserProfile.objects.filter(username="IndianAI").exists(): | ||
user = UserProfile.objects.create_user(username="IndianAI", email="[email protected]") | ||
user.set_unusable_password() | ||
user.displayname = "Sitting AI" | ||
file = File(open('static/assets/profile/indianai.jpg', "rb")) | ||
user.avatar.save(f"{file.name}.jpg", file, save=True) | ||
file.close() | ||
user.is_verified = True | ||
user.indian_wallet = 1000 | ||
user.is_indianai = True | ||
user.elo_point = 1000 | ||
user.save() | ||
self.stdout.write(self.style.SUCCESS('IndianAI created successfully.')) | ||
# Load store data | ||
with open('static/assets/stores/store_data.json') as f: | ||
data = json.load(f) | ||
def handle(self, *args, **options): | ||
# Create superuser if not exists | ||
if not UserProfile.objects.filter(username="Bitlis").exists(): | ||
UserProfile.objects.create_superuser("Bitlis", "[email protected]", environ.get("SUPER_PASS", default="9247")) | ||
self.stdout.write(self.style.SUCCESS('Superuser created successfully.')) | ||
# Create IndianAI if not exists | ||
if not UserProfile.objects.filter(username="IndianAI").exists(): | ||
user = UserProfile.objects.create_user(username="IndianAI", email="[email protected]") | ||
user.set_unusable_password() | ||
user.displayname = "Sitting AI" | ||
file = File(open('static/assets/profile/indianai.jpg', "rb")) | ||
user.avatar.save(f"{file.name}.jpg", file, save=True) | ||
file.close() | ||
user.is_verified = True | ||
user.indian_wallet = 1000 | ||
user.is_indianai = True | ||
user.elo_point = 1000 | ||
user.save() | ||
self.stdout.write(self.style.SUCCESS('IndianAI created successfully.')) | ||
# Load store data | ||
with open('static/assets/stores/store_data.json') as f: | ||
data = json.load(f) | ||
|
||
for item_data in data: | ||
StoreItem.objects.create(**item_data) | ||
for item_data in data: | ||
StoreItem.objects.create(**item_data) | ||
|
||
self.stdout.write(self.style.SUCCESS('Store data loaded successfully.')) | ||
self.stdout.write(self.style.SUCCESS('Store data loaded successfully.')) |
Oops, something went wrong.