Skip to content

Commit

Permalink
Merge pull request #159 from UnitapApp/feature/gastap_dynamic_round_d…
Browse files Browse the repository at this point in the history
…uration

db error permissions
  • Loading branch information
Mohamad Bastin authored Oct 27, 2023
2 parents 01e4cd4 + 9149c88 commit 8b76d1e
Show file tree
Hide file tree
Showing 7 changed files with 68 additions and 140 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Generated by Django 4.0.4 on 2023-10-27 18:29

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('permissions', '0005_onceinalifetimeverification'),
]

operations = [
# migrations.RemoveField(
# model_name='onceperweekverification',
# name='permission_ptr',
# ),
migrations.DeleteModel(
name='OncePerMonthVerification',
),
migrations.DeleteModel(
name='OncePerWeekVerification',
),
]
63 changes: 0 additions & 63 deletions permissions/migrations/0007_initial.py

This file was deleted.

51 changes: 25 additions & 26 deletions permissions/serializers.py
Original file line number Diff line number Diff line change
@@ -1,35 +1,34 @@
# from rest_framework import serializers
# from rest_polymorphic.serializers import PolymorphicSerializer
from rest_framework import serializers
from rest_polymorphic.serializers import PolymorphicSerializer

from permissions.models import (
BrightIDAuraVerification,
BrightIDMeetVerification,
Permission,
)

# from permissions.models import (
# Permission,
# BrightIDMeetVerification,
# BrightIDAuraVerification,
# )

class PermissionBaseSerializer(serializers.ModelSerializer):
class Meta:
model = Permission
fields = ["id", "name", "description"]

# class PermissionBaseSerializer(serializers.ModelSerializer):
# class Meta:
# model = Permission
# fields = ["id", "name", "description"]

class BrightIDMeetVerificationSerializer(PermissionBaseSerializer):
class Meta:
model = BrightIDMeetVerification
fields = ["id", "name", "description"]

# class BrightIDMeetVerificationSerializer(PermissionBaseSerializer):
# class Meta:
# model = BrightIDMeetVerification
# fields = ["id", "name", "description"]

class BrightIDAuraVerificationSerializer(PermissionBaseSerializer):
class Meta:
model = BrightIDAuraVerification
fields = ["id", "name", "description"]

# class BrightIDAuraVerificationSerializer(PermissionBaseSerializer):
# class Meta:
# model = BrightIDAuraVerification
# fields = ["id", "name", "description"]


# class PermissionSerializer(PolymorphicSerializer):
# model_serializer_mapping = {
# Permission: PermissionBaseSerializer,
# BrightIDMeetVerification: BrightIDMeetVerificationSerializer,
# BrightIDAuraVerification: BrightIDAuraVerificationSerializer,
# }
class PermissionSerializer(PolymorphicSerializer):
model_serializer_mapping = {
Permission: PermissionBaseSerializer,
BrightIDMeetVerification: BrightIDMeetVerificationSerializer,
BrightIDAuraVerification: BrightIDAuraVerificationSerializer,
}
1 change: 1 addition & 0 deletions prizetap/migrations/0003_raffle_permissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
class Migration(migrations.Migration):

dependencies = [
('permissions', '0004_oncepermonthverification'),
('prizetap', '0002_raffle_is_prize_nft'),
]

Expand Down
1 change: 1 addition & 0 deletions tokenTap/migrations/0002_tokendistribution_permissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
class Migration(migrations.Migration):

dependencies = [
('permissions', '0001_initial'),
('tokenTap', '0001_initial'),
]

Expand Down
18 changes: 18 additions & 0 deletions tokenTap/migrations/0020_alter_constraint_name.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 4.0.4 on 2023-10-27 18:29

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('tokenTap', '0019_alter_constraint_name'),
]

operations = [
migrations.AlterField(
model_name='constraint',
name='name',
field=models.CharField(choices=[('BrightIDMeetVerification', 'BrightIDMeetVerification'), ('BrightIDAuraVerification', 'BrightIDAuraVerification'), ('OncePerMonthVerification', 'OncePerMonthVerification'), ('OnceInALifeTimeVerification', 'OnceInALifeTimeVerification'), ('OptimismHasClaimedGasInThisRound', 'OptimismHasClaimedGasInThisRound')], max_length=255, unique=True),
),
]

0 comments on commit 8b76d1e

Please sign in to comment.