[ Avaa Bypassed ]




Upload:

Command:

hmhc3928@3.148.144.139: ~ $
from peewee import IntegrityError, Model as BaseModel


class Model(BaseModel):
    """
    Common Model class that fix create_or_get method with using CompositeKey.
    https://stackoverflow.com/questions/35167628/peewee-create-or-get-error-in-model-with-compositekey
    """

    @classmethod
    def create_or_get(cls, **kwargs):
        try:
            with cls._meta.database.atomic():
                return cls.create(**kwargs), True
        except IntegrityError:
            query = []
            for field_name, value in kwargs.items():
                field = getattr(cls, field_name)
                field_is_primary_key = (
                    field.name in cls._meta.primary_key.field_names
                    if cls._meta.composite_key
                    else field.primary_key
                )
                if field.unique or field_is_primary_key:
                    query.append(field == value)
            return cls.get(*query), False

Filemanager

Name Type Size Permission Actions
__pycache__ Folder 0755
__init__.py File 963 B 0644
event_hook.py File 1.74 KB 0644
icontact.py File 1.16 KB 0644
infected_domain.py File 4.24 KB 0644
instance.py File 481 B 0644
messages_to_send.py File 1.37 KB 0644
simplification.py File 5.05 KB 0644
tls_check.py File 1.29 KB 0644