mirror of
https://github.com/creyD/asiimov.git
synced 2026-06-12 00:52:23 +02:00
Removed API KEY Feature
While this would easily avoid the api key limit, Valve wouldn't like this, as it isn't the purpose of the keys.
This commit is contained in:
@@ -4,13 +4,13 @@ A free, intuitive, open source CS:GO item trading platform.
|
|||||||
|
|
||||||
## Goals
|
## Goals
|
||||||
|
|
||||||
- You can authenticate with your steam account
|
- (done) You can authenticate with your steam account
|
||||||
- You can create 'offers' using your items as a base
|
- You can create 'offers' using your items as a base
|
||||||
- A border colour indicates if the item is still in your inventory
|
- A border colour indicates if the item is still in your inventory
|
||||||
- You can manually renew an offer page to check if the item is still in the inventory (if we know the api key)
|
- You can manually renew an offer page to check if the item is still in the inventory
|
||||||
- You can send trade offers (preferably with the items preselected or even completely automated)
|
- You can send trade offers (preferably with the items preselected or even completely automated)
|
||||||
- You have a profile with some badges to get your profile semi verified (email, steam api key, trade link)
|
- You have a profile with some badges to get your profile semi verified (email, trade link...)
|
||||||
- Everything is available for free (given you login with steam and provide the api key)
|
- Everything is available for free
|
||||||
- Items should be displayed with: Item ID, Inspect Link, Pattern Index (...) NO PRICES! We don't want to anger Valve!
|
- Items should be displayed with: Item ID, Inspect Link, Pattern Index (...) NO PRICES! We don't want to anger Valve!
|
||||||
- Simple user design, minimalistic, less pages more features
|
- Simple user design, minimalistic, less pages more features
|
||||||
- (optional) You can mark your inventory items as "for trade" or "holding on to this"
|
- (optional) You can mark your inventory items as "for trade" or "holding on to this"
|
||||||
|
|||||||
17
src/core/migrations/0007_remove_gamer_api_key.py
Normal file
17
src/core/migrations/0007_remove_gamer_api_key.py
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
# Generated by Django 3.0.2 on 2020-01-22 12:34
|
||||||
|
|
||||||
|
from django.db import migrations
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('core', '0006_auto_20200119_1240'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.RemoveField(
|
||||||
|
model_name='gamer',
|
||||||
|
name='API_KEY',
|
||||||
|
),
|
||||||
|
]
|
||||||
@@ -95,7 +95,6 @@ class Gamer(models.Model):
|
|||||||
|
|
||||||
# Asiimov specific information
|
# Asiimov specific information
|
||||||
inventory = models.ManyToManyField(ItemInstance) # Temporary storage of items for improving site performance
|
inventory = models.ManyToManyField(ItemInstance) # Temporary storage of items for improving site performance
|
||||||
API_KEY = models.CharField(max_length=32, null=True) # Optionally use the API KEY of the user
|
|
||||||
badges = models.ManyToManyField(Badge)
|
badges = models.ManyToManyField(Badge)
|
||||||
system_user = models.OneToOneField(User, on_delete=models.CASCADE)
|
system_user = models.OneToOneField(User, on_delete=models.CASCADE)
|
||||||
offer_count = models.IntegerField(default=0)
|
offer_count = models.IntegerField(default=0)
|
||||||
|
|||||||
@@ -1,38 +1,45 @@
|
|||||||
{% extends 'master.html' %}
|
{% extends 'master.html' %} {% load static %} {% block header %}
|
||||||
{% load static %}
|
|
||||||
|
|
||||||
{% block header %}
|
|
||||||
<!-- Adding custom style sheet for profile-->
|
<!-- Adding custom style sheet for profile-->
|
||||||
<link rel="stylesheet" href="{% static 'css/profile.css' %}">
|
<link rel="stylesheet" href="{% static 'css/profile.css' %}" />
|
||||||
{% endblock %}
|
{% endblock %} {% block content %}
|
||||||
|
|
||||||
{% block content %}
|
|
||||||
<div class="content_block">
|
<div class="content_block">
|
||||||
<p><img src="{{ gamer.avatar }}" /></p>
|
<p><img src="{{ gamer.avatar }}" /></p>
|
||||||
<h2>{{ gamer.personaname }} {% if request.user.gamer == gamer %}(Your Profile){% endif %}</h2>
|
<h2>
|
||||||
|
{{ gamer.personaname }} {% if request.user.gamer == gamer %}(Your Profile){%
|
||||||
|
endif %}
|
||||||
|
</h2>
|
||||||
|
|
||||||
<h3>Links</h3>
|
<h3>Links</h3>
|
||||||
<ul>
|
<ul>
|
||||||
<a href="{{ gamer.profileurl }}" target="_blank"><li>Steam</li></a>
|
<a href="{{ gamer.profileurl }}" target="_blank"><li>Steam</li></a>
|
||||||
<a href="{% url 'profile_inventory' gamer.steamid%}"><li>Inventory</li></a>
|
<a href="{% url 'profile_inventory' gamer.steamid%}"><li>Inventory</li></a>
|
||||||
<a href="http://csgo.exchange/id/{{ gamer.steamid }}"><li>csgo.exchange</li></a>
|
<a href="http://csgo.exchange/id/{{ gamer.steamid }}"
|
||||||
{% if gamer.tradeurl %}<a href="{{ gamer.tradeurl }}" target="_blank"><li>Trade</li></a>{% endif %}
|
><li>csgo.exchange</li></a
|
||||||
|
>
|
||||||
|
{% if gamer.tradeurl %}<a href="{{ gamer.tradeurl }}" target="_blank"
|
||||||
|
><li>Trade</li></a
|
||||||
|
>{% endif %}
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<h3>Info</h3>
|
<h3>Info</h3>
|
||||||
<p>Steam ID: {{ gamer.steamid }}</p>
|
<p>Steam ID: {{ gamer.steamid }}</p>
|
||||||
<p>Profile: {% if gamer.profilestate %}Public Profile{% else %}Private Profile{% endif %}</p>
|
<p>
|
||||||
<p>Comments: {% if gamer.commentpermission %}Allowed{% else %}Denied{% endif %}</p>
|
Profile: {% if gamer.profilestate %}Public Profile{% else %}Private
|
||||||
<p>Locale: {% if gamer.loccountrycode %}{{ gamer.loccountrycode }}{% else %}Not provided{% endif %}</p>
|
Profile{% endif %}
|
||||||
{% if gamer.API_KEY %}<p style="color: red">This is an API Key Sponsor!</p>{% endif %}
|
</p>
|
||||||
|
<p>
|
||||||
|
Comments: {% if gamer.commentpermission %}Allowed{% else %}Denied{% endif %}
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
Locale: {% if gamer.loccountrycode %}{{ gamer.loccountrycode }}{% else %}Not
|
||||||
|
provided{% endif %}
|
||||||
|
</p>
|
||||||
|
|
||||||
<h3>Badges</h3>
|
<h3>Badges</h3>
|
||||||
<p>
|
<p>
|
||||||
{% for badge in gamer.badges.all %}
|
{% for badge in gamer.badges.all %}
|
||||||
<img src="{{ badge.icon }}" placeholder="{{ badge.name }}">
|
<img src="{{ badge.icon }}" placeholder="{{ badge.name }}" />
|
||||||
{% empty %}
|
{% empty %} No badges earned yet. {% endfor %}
|
||||||
No badges earned yet.
|
|
||||||
{% endfor %}
|
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<h3>Statistics</h3>
|
<h3>Statistics</h3>
|
||||||
|
|||||||
@@ -1,20 +1,20 @@
|
|||||||
{% extends 'master.html' %}
|
{% extends 'master.html' %} {% load static %} {% block header %}
|
||||||
{% load static %}
|
|
||||||
|
|
||||||
{% block header %}
|
|
||||||
<!-- Adding custom style sheet for profile-->
|
<!-- Adding custom style sheet for profile-->
|
||||||
<link rel="stylesheet" href="{% static 'css/profile.css' %}">
|
<link rel="stylesheet" href="{% static 'css/profile.css' %}" />
|
||||||
{% endblock %}
|
{% endblock %} {% block content %}
|
||||||
|
|
||||||
{% block content %}
|
|
||||||
<div class="content_block">
|
<div class="content_block">
|
||||||
<h2>Settings</h2>
|
<h2>Settings</h2>
|
||||||
<a href="http://steamcommunity.com/id/me/tradeoffers/privacy#trade_offer_access_url" target="_blank">Find your trade URL!</a>
|
<a
|
||||||
{% if gamer.API_KEY %}<a href="{% url 'profile_update' gamer.steamid %}">Synchronize profile from Steam</a>{% endif %}
|
href="http://steamcommunity.com/id/me/tradeoffers/privacy#trade_offer_access_url"
|
||||||
|
target="_blank"
|
||||||
|
>Find your trade URL!</a
|
||||||
|
>
|
||||||
|
<a href="{% url 'profile_update' gamer.steamid %}"
|
||||||
|
>Synchronize profile from Steam</a
|
||||||
|
>
|
||||||
|
|
||||||
<form role="from" method="post" action="{% url 'me_settings' %}">
|
<form role="from" method="post" action="{% url 'me_settings' %}">
|
||||||
{% csrf_token %}
|
{% csrf_token %} {{ form.as_p }}
|
||||||
{{ form.as_p }}
|
|
||||||
<button type="submit">Set Trade URL</button>
|
<button type="submit">Set Trade URL</button>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -153,9 +153,9 @@ def profile_inventory(request, steamID):
|
|||||||
|
|
||||||
@login_required
|
@login_required
|
||||||
def profile_update(request, steamID):
|
def profile_update(request, steamID):
|
||||||
if (request.user.steamid == steamID and request.user.gamer.API_KEY) or request.user.is_staff:
|
if request.user.steamid == steamID or request.user.is_staff:
|
||||||
the_gamer = get_object_or_404(Gamer, steamid=steamID)
|
the_gamer = get_object_or_404(Gamer, steamid=steamID)
|
||||||
info = getUserInfo(steamID, API_KEY=request.user.gamer.API_KEY or None)
|
info = getUserInfo(steamID)
|
||||||
the_gamer.communityvisibilitystate = (True if info['communityvisibilitystate'] == 3 else False)
|
the_gamer.communityvisibilitystate = (True if info['communityvisibilitystate'] == 3 else False)
|
||||||
the_gamer.profilestate = info['profilestate']
|
the_gamer.profilestate = info['profilestate']
|
||||||
the_gamer.personaname = info['personaname']
|
the_gamer.personaname = info['personaname']
|
||||||
|
|||||||
Reference in New Issue
Block a user