mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-09 19:40:19 +00:00
feat: make student card unique per user
This commit is contained in:
@ -69,7 +69,7 @@ class Command(BaseCommand):
|
||||
# sqlite doesn't support this operation
|
||||
return
|
||||
sqlcmd = StringIO()
|
||||
call_command("sqlsequencereset", *args, stdout=sqlcmd)
|
||||
call_command("sqlsequencereset", "--no-color", *args, stdout=sqlcmd)
|
||||
cursor = connection.cursor()
|
||||
cursor.execute(sqlcmd.getvalue())
|
||||
|
||||
@ -137,11 +137,10 @@ class Command(BaseCommand):
|
||||
)
|
||||
|
||||
self.reset_index("club")
|
||||
for bar_id, bar_name in settings.SITH_COUNTER_BARS:
|
||||
Counter(id=bar_id, name=bar_name, club=bar_club, type="BAR").save()
|
||||
self.reset_index("counter")
|
||||
counters = [
|
||||
*[
|
||||
Counter(id=bar_id, name=bar_name, club=bar_club, type="BAR")
|
||||
for bar_id, bar_name in settings.SITH_COUNTER_BARS
|
||||
],
|
||||
Counter(name="Eboutic", club=main_club, type="EBOUTIC"),
|
||||
Counter(name="AE", club=main_club, type="OFFICE"),
|
||||
Counter(name="Vidage comptes AE", club=main_club, type="OFFICE"),
|
||||
|
@ -35,8 +35,8 @@
|
||||
{% endif %}
|
||||
|
||||
|
||||
{% if student_card %}
|
||||
{{ student_card }}
|
||||
{% if student_card_fragment %}
|
||||
{{ student_card_fragment }}
|
||||
<p class="justify">
|
||||
{% trans %}You can add a card by asking at a counter or add it yourself here. If you want to manually
|
||||
add a student card yourself, you'll need a NFC reader. We store the UID of the card which is 14 characters long.{% endtrans %}
|
||||
|
@ -571,7 +571,7 @@ class UserPreferencesView(UserTabsMixin, CanEditMixin, UpdateView):
|
||||
if not hasattr(self.object, "trombi_user"):
|
||||
kwargs["trombi_form"] = UserTrombiForm()
|
||||
if hasattr(self.object, "customer"):
|
||||
kwargs["student_card"] = StudentCardFormView.get_template_data(
|
||||
kwargs["student_card_fragment"] = StudentCardFormView.get_template_data(
|
||||
self.object.customer
|
||||
).render(self.request)
|
||||
return kwargs
|
||||
|
Reference in New Issue
Block a user