Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Maybe Bug] Saving Drafts will empty "Reason" #729

Open
Blackstareye opened this issue Jan 19, 2025 · 1 comment
Open

[Maybe Bug] Saving Drafts will empty "Reason" #729

Blackstareye opened this issue Jan 19, 2025 · 1 comment

Comments

@Blackstareye
Copy link

If we edit the installer script and test things, we often need to save the current draft of the script.
If we do that, all informations will be safed, except the field reason. This seems to be a bug ?

Before Save:

Image

After Save:
Image

Firefox: 132.0.1 (64-Bit); OS: Nobara (Fedora variant)

@Blackstareye
Copy link
Author

I think it is this piece of code

in views/pages.py (Line 295)

def edit_draft(request, draft_id, game=None):
    """Display an edit form for install scripts"""
    if draft_id:
        draft = get_object_or_404(InstallerDraft, id=draft_id)
    else:
        draft = InstallerDraft(
            user=request.user,
            game=game,
            created_at=timezone.now()
        )

    # Reset reason when the installer is edited.
    # THIS LINE HERE START
    draft.reason = ""
    # THIS LINE HERE END

    form = InstallerEditForm(request.POST or None, instance=draft)
    if request.method == "POST" and form.is_valid():
        draft = form.save()
        # draft.review = ""

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant